Ik heb een stuk code genomen, om mijn movie catalog te creeren, doch zit nu met een vraagje:
Is het mogelijk om een iframe te laden, bij elke keuze die ik maak in de select list, telkens ik op de up/down pijtjes druk van het toetsenbord.
zodat als ik op de eerste film klik, movieslist_1.html geladen word, wat nu werkt, doch als ik dan op het "Down" pijltje druk (op het keyboard), dat niet enkel End of days tevoorschijn komt in de select box, maar ook direct de iframe zich aanpast naar movieslist_2.html ?
Is het mogelijk om een iframe te laden, bij elke keuze die ik maak in de select list, telkens ik op de up/down pijtjes druk van het toetsenbord.
zodat als ik op de eerste film klik, movieslist_1.html geladen word, wat nu werkt, doch als ik dan op het "Down" pijltje druk (op het keyboard), dat niet enkel End of days tevoorschijn komt in de select box, maar ook direct de iframe zich aanpast naar movieslist_2.html ?
Code:
<!-- The code below is the JavaScript Code in the HEAD of this document that works the drop down menu-->
<script type="text/javascript">
<!--//
function goToPage763(mySelect)
{
PageIndex2=mySelect.selectedIndex;
{
if
(
mySelect.options[PageIndex2].value != "none"
)
{
//this is the key code in the JavaScript to open the new page in
//the iframe:-
frames['iframe2'].location.href = mySelect.options[PageIndex2].value;
}
}
}
//-->
</script>
<form name="form763">
<p>
<select name="select763" size="1" onchange="goToPage763(this.form.select763)">
<option value="none" selected="selected">
Pick a movie
</option>
<option value="movieslist_1.html">
Bird on a wire
</option>
<option value="movieslist_2.html">
End of days
</option>
<option value="movieslist_3.html">
Enemy of the state
</option>
<iframe name="iframe2" src="index.html" align="top" height="100%" width="95%" hspace="10" vspace="10" align="middle">
</select>
</p>
<p>
<!-- The code below is the code in the body of this document that writes the form-->
<iframe name="iframe2" src="index.html" align="top" height="100%" width="95%" hspace="10" vspace="10" align="middle">
If you can see this, your browser does not support iframes!
</iframe>
</p>
</form>