PDA

View Full Version : Loading into the bottom frame


peterperkins
06-18-2001, 09:25 AM
I am using the following javascript on my page, it works fine but i want it to load the target URL's or files into the bottom frame of the page, so it doesnt load over the top of the menus and text etc.

How can I modify it to to do this?

I would be greatful for some help.

Thanks Peter Perkins

<form name="doublecombo">
<p><select name="stage1" size="5" onChange="redirect(this.options.selectedIndex)">
<option>Author Information</option>
<option>Cartoons</option>
<option>Essays</option>
<option>Stories</option>
<option>Paintings & Sculptures</option>
<option>Animations</option>
<option>Links</option>
<option>CD Ordering Information</option>
</select>
<select name="stage2" size="5">
<option value="peterperkinssnr.jpg">Peter Perkins Senior</option>
<option value="peterperkinsjnr.jpg">Peter Perkins Junior</option>
<option value="austinperkins.jpg">Austin Perkins</option>
</select>
<input type="button" name="test" value="Go!"onClick="go()">
</p>

<script>
<!--
var groups=document.doublecombo.stage1.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()

group[0][0]=new Option("Peter Perkins Senior","peterperkinssnr.jpg")
group[0][1]=new Option("Peter Perkins Junior","peterperkinsjnr.jpg")
group[0][2]=new Option("Austin Perkins","austinperkins.jpg")

group[1][0]=new Option("Cartoons By Peter Perkins","001.jpg")
group[1][1]=new Option("Fartiloquist","002.jpg")
group[1][2]=new Option("Fatal Error","003.jpg")
group[1][3]=new Option("A Horrible Little Man","004.jpg")
group[1][4]=new Option("A James Watt","005.jpg")
group[1][5]=new Option("A Lucky Escape","006.jpg")
group[1][6]=new Option("A Massive Heart Attack","007.jpg")
group[1][7]=new Option("A Bunch Of Wild Fowlers","008.jpg")
group[1][8]=new Option("Preliminary Interview","009.jpg")
group[1][9]=new Option("Black And Decker","010.jpg")


group[2][0]=new Option("A Beadling Shame","abeadlingshame.htm")
group[2][1]=new Option("A Delicate Balance","adelicatebalance.htm")
group[2][2]=new Option("Adult Giants","adultgiants.htm")
group[2][3]=new Option("A Grey New World","agreynewworld.htm")

group[3][0]=new Option("Hans Boche","hansboche.htm")
group[3][1]=new Option("Travels With A Velosolex","travelswithavelosolex.htm")
group[3][2]=new Option("The Owl","theowl.htm")
group[3][3]=new Option("Cancer Bravado","cancerbravado.htm")
group[3][4]=new Option("The Wooden Engine (Includes Illustrations)","thewoodenengine.htm")

group[4][0]=new Option("Peter Perkins (Self Portrait)","00.jpg")
group[4][1]=new Option("Citroen 2CV Sculpture","01.jpg")
group[4][2]=new Option("Planet Carton Headboard","02.jpg")
group[4][3]=new Option("Boat Builders","03.jpg")
group[4][4]=new Option("Chris (Portrait)","04.jpg")
group[4][5]=new Option("Spare Do Not Press","05.jpg")
group[4][6]=new Option("Fields","06.jpg")
group[4][7]=new Option("Boat Builders","07.jpg")
group[4][8]=new Option("Girl Signing","08.jpg")
group[4][9]=new Option("Pale","09.jpg")
group[4][10]=new Option("Send No Money Now","10.jpg")
group[4][11]=new Option("The Boat","11.jpg")
group[4][12]=new Option("The Street","12.jpg")
group[4][13]=new Option("Tubism","13.jpg")
group[4][14]=new Option("Wall Mural 1","14.jpg")
group[4][15]=new Option("Wall Mural 2","15.jpg")
group[4][16]=new Option("Wall Mural 3","16.jpg")
group[4][17]=new Option("Wall Mural 4","17.jpg")
group[4][18]=new Option("Wall Mural 5","18.jpg")

group[5][0]=new Option("The Worm","worm.gif")
group[5][1]=new Option("Thong","thong.gif")
group[5][2]=new Option("Grand Theory","grandtheory.gif")
group[5][3]=new Option("Frog","frog.gif")
group[5][4]=new Option("Bulldozer","bulldozer.gif")
group[5][5]=new Option("Bounces","bounces.gif")

group[6][0]=new Option("The Daily Reckless","http://tommymackay.tripod.com/home.htm")
group[6][1]=new Option("The National Autocycle Club","http://www.buzzing.org/")
group[6][2]=new Option("Cancer Help","http://www.cancerhelp.org.uk/default.asp")
group[6][3]=new Option("The Despondent","http://www.thedespondent.com/")

group[7][0]=new Option("How To Order The Website CD","cdorder.jpg")

var temp=document.doublecombo.stage2

function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
}

function go(){
location=temp.options[temp.selectedIndex].value
}
//-->
</script>
</form>

kdjoergensen
06-18-2001, 03:33 PM
function go(){
location=temp.options[temp.selectedIndex].value
}

change it to:
function go(){
top.frames[1].location=temp.options[temp.selectedIndex].value
}


if your frameset looks like this:

<html>
<frameset rows="80%,20%">
<frame name="main" src="home.html">
<frame name="output" src="startpage.html">
</frameset>
</html>

frames[1] will refer to the second frame (output) above. frames[number] are a listing of each frame in the page as they appear in the frameset document.
example:
<frame name="frameA" ..>
<frame name="frameB" ..>
<frame name="frameC" ..>

to load a document into each of above frames:
frameA: top.frames[0].location.href = ...
frameB: top.frames[1].location.href = ...
frameC: top.frames[2].location.href = ...

Hope above was of any assistance..
Kenneth