Neither the original nor the update that you are using is rated for Safari, but there might be a way to get it to work. First of all though, you have used incorrect syntax in targeting the iframe with your links. This may have nothing to do with the problem but should be taken care of first, just to see. For example, you have:
HTML Code:
<a href="welcome.htm" target="myframe">X</a>
The target="myframe" means that the page should open in a window or frame named myframe. However, you have no such named frame. You have one with the id of myframe but, that's different. So, just to eliminate this as a possible problem and to make your page work in a wider number of browsers (IE and FF both open a new window), give the iframe a name as well as an id, they can be the same:
HTML Code:
<iframe name="myframe" id="myframe" onload="sizeFrame(this)" src="welcome.htm" scrolling="no" width="100%" height="300" marginwidth="0" marginheight="0" frameborder="yes" align="center" vspace="0" hspace="0" style="border:1px #FF99CC solid; overflow:hidden;"></iframe>
See how that goes. If that doesn't take care of it, see if the onload event is firing or not by adding an alert to this function:
Code:
function sizeFrame(frameObj){
alert('fired');
if ((frameObj.contentDocument && (frameObj.contentDocument.body.offsetHeight||frameObj.contentDocument.documentElement.offsetHeight))||frameObj.Document && frameObj.Document.body.scrollHeight){
if (window.opera)
setClicks(frameObj)
var contentHeight=window.opera? frameObj.contentDocument.documentElement.offsetHeight : frameObj.contentDocument? frameObj.contentDocument.body.offsetHeight+13 : frameObj.Document.body.scrollHeight+4
var contentWidth=window.opera? collectWidth(frameObj.contentDocument) : frameObj.contentDocument? frameObj.contentDocument.documentElement.offsetWidth : frameObj.Document.body.scrollWidth
var frameWidth=frameObj.offsetWidth
if (window.opera&&frameWidth>=contentWidth)
frameObj.contentDocument.body.style.overflow='hidden'
frameObj.style.overflow='visible'
frameObj.height = frameWidth<contentWidth? contentHeight+18 : contentHeight+3;
}
}
If it will show the alert each time a new page is loaded into the iframe, then at least the script is trying to work and what may be required is to have Safari follow the same path as Opera, in which your page works fine and which has different code in the script to get the height correct than other browsers, this may also be preferred by Safari. More on that later, if needed.
Bookmarks