...

View Full Version : Displaying content in an inline frame from amenu choice



Skidz
12-10-2007, 09:13 PM
Hi,

I want to manipulate this code so that when i click on an option in the menu instead of alerting music choice (n) it brings up different menu options like the bands albums or similar content in another inline frame... Any help would be greatfully appreciated.



<html>
<head>
<script type='text/javascript'>
pop=["Snow Patrol","The Fray","Fleetwood Mac","Status Quo"];
function message(i){
alert('music choice'+i);
}
function show(){
music=pop
var s="<html><head></head><body>";
s+="<form><select size='"+music.length+"' onchange='parent.message(this.selectedIndex);' >";
for(c=0;c<music.length;c++)
s+="<option>"+music[c]+"</option>";
s+="</select></form></body></html>";
with(document.getElementById('examples').contentDocument){
open();
write(s);
close();
}
}
</script>
</head>

<body onload="show()">
<p>Dynamically written content</p>

<iframe id='examples'></iframe>
</body>
</html>


PS i have used PHP tags on this site to show colors.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum