|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Iframe default content
Hi, Newbie to the forum.
I wanted to use Iframes with a drop down menu script. It works, however I am stuck with how to specify the default iframe content. I used a script I found on the web, its a free for use one. This is the main script <script language="JavaScript" type="text/JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_jumpMenuGo(selName,targ,restore){ //v3.0 var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore); } //--> </script> This is the top of the menu <script language="JavaScript"> <!-- Begin function leapto(form) { var myindex=form.dest.selectedIndex parent.CONTENT.location.href=(form.dest.options[myindex].value); // You can output to ANY frame using: parent.[framename].location.href } // End --> </script> <div align="center"> <center> <form name="myform"> <select name="dest" class="style7" onChange="leapto(this.form)"> <option value="blank.htm" selected>Choose A Link </option> <option value="axxessident.php">Axxess Ident</option> <option value="baxall.php">Baxall</option> <option value="bbv.php">BBV</option> The menu works, but when you go to the actual page it defaults to some rubbish because it has no page set and thus its telling me it cant find the page I am looking for. Where, in the above script would I set the detault page to optn with the iframe prior to a user selecting anything from the menu? Thanks in advance for any help. If, I should use a different type of script, let me know and I will do. |
|
#2
|
||||
|
||||
|
Hi
In the page "wrapping" the IFRAME add src="page.asp" to the IFRAME tag MK |
|
#3
|
|||
|
|||
|
Working
Thanks, that wortked perfect. I thought that the source had to stay as it was for the drop down menu to work, now I see thats rubbish.
Many thanks for the help, working perfect now. |
|
#4
|
||||
|
||||
|
Quote:
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Iframe default content |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|