PDA

View Full Version : Firefox and Iframe SSI script II w/ Drop Down menu



Hangar1
01-03-2007, 05:46 AM
1) Script Title: Iframe SSI script II

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex17/iframessi2.htm

3) Describe problem:

I have a dropdown menu linked to pages to reload in the iframe on my website, and it works beautifully in IE, but it doesn't work at all in FF. I'm using a CMS, Xoops, but i don't think that matters and i know it's gotta be something simple dealing with the way im linkin the dropdown and links or something.. I REALLY need this to work !! Ugh! here's the code...


<head><script>
<!--
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
else {if (lowtarget=="_blank") {window.open(loc);}
else {if (lowtarget=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf("*");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
//-->
</script>
<script type="text/javascript">

/***********************************************
* IFrame SSI script II- Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="no"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

</script></head>
<CENTER>
<form action="dummy" method="post">
<select name="choice" size="1" onChange="jump(this.form)">
<option value="http://planet.fastwhb.com/~hangar1/images/pleaseselect.jpg*myframe">- Choose a Date -</option>
<option value="http://planet.fastwhb.com/~hangar1/weekdays.jpg*myframe">Wednesday, Jan. 3rd</option>
<option value="http://planet.fastwhb.com/~hangar1/weekdays.jpg*myframe">Thursday, Jan. 4th</option>
<option value="http://planet.fastwhb.com/~hangar1/weekend.jpg*myframe">Friday, Jan. 5th</option>
<option value="http://planet.fastwhb.com/~hangar1/weekend2.jpg*myframe">Saturday, Jan. 6th</option>
<option value="http://planet.fastwhb.com/~hangar1/weekend3.jpg*myframe">Sunday, Jan. 7th</option>
<option value="http://planet.fastwhb.com/~hangar1/weekdays2.jpg*myframe">Monday, Jan. 8th</option>
<option value="http://planet.fastwhb.com/~hangar1/weekdays2.jpg*myframe">Tuesday, Jan. 9th</option>
<option value="http://planet.fastwhb.com/~hangar1/weekdays2.jpg*myframe">Wednesday, Jan. 10th</option>
<option value="http://planet.fastwhb.com/~hangar1/weekdays2.jpg*myframe">Thursday, Jan. 11th</option>
</select>
</form></CENTER>
<iframe id="myframe" src="http://planet.fastwhb.com/~hangar1/images/pleaseselect.jpg" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>

Thanks for any help!
--
God Bless,
Nate Birkley

Hangar1
01-03-2007, 08:48 PM
PLEASE HELP! I really need to launch this website ASAP! And this Iframe is ESSENTIAL b/c we are a theatre and in this area there will be showtimes.