interfacing between two scripts

  • sarsonuk
  • Newbie
  • Newbie
  • sarsonuk
  • Posts: 7
  • Loc: UK

Post 3+ Months Ago

Dear Fellas,
I have two script that I would like to interface together.
One is a menu item that is spawned across a frame so that the menu item is active in the frame that the second script is active. This can be seen at http://www.geocities.com/sarsonuk/travel.html
The second script is a slide show script that selects a set of pictures to preview, this can be seen at http://www.geocities.com/sarsonuk/Trave ... ca_ss.html.
The slide show is controlled by setting an array index and executing the function javascript:setslide(9).
The menu I am using has a string field for the path to the file that you want to load. I tried to make this path execute the javascript function but this didn't work, I think i'm missing a relative statement like parent.'Framename' etc but I am not too sure as I am a very new user to javascript.
Any help very much appreciated.
Thanks
Pete
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Could you give us the code that you are trying to use please thankyou.
  • sarsonuk
  • Newbie
  • Newbie
  • sarsonuk
  • Posts: 7
  • Loc: UK

Post 3+ Months Ago

Find below menu code

Menu1=new Array("","","./images/button1up.png",10,21,123);
Menu1_1=new Array("SugarLoaf Maine 2002-2004","../america/sugarloaf/sugarloaf.html","",0,20,190);
Menu1_2=new Array("Niagra Falls USA/CAN Feb 2004","../america/Niagra/niagra.html","",0);
Menu1_3=new Array("Philadelphia PA USA Jan 2004","../america/Philadelphia/Philadelphia.html","",0);
Menu1_4=new Array("Dallas TX USA Nov 2003","../america/Dallas/dallas.html","",0);
Menu1_5=new Array("California USA Feb 2002","../america/california/california.html","",0);
Menu1_6=new Array("Providence RI USA Feb 2002","../america/providence/providence.html","",0);
Menu1_7=new Array("Plymouth MA USA feb 2002","../america/plymouth/plymouth.html","",0);
Menu1_8=new Array("Boston MA USA 2000-2001","../america/boston/boston.html","",0);
Menu1_9=new Array("White Mountains NH Oct 2001","../america/white_mountains/while_mountains.html","",0);
Menu1_10=new Array("New York NY USA Apr 2001","../america/NewYork/ny.html","",0);
Menu2=new Array("","","./images/button2up.png",2,21,123);
Menu2_1=new Array("Paris France Aug 2001","../paris/paris.html","",0,20,190);
Menu2_2=new Array("Copenhagen Denmark Feb 2001","../copenhagen/copenhagen.html","",0,20,150);

Menu3=new Array("","","./images/button3up.png",1,21,123);
Menu3_1=new Array("Singapore June 2003","../singapore/singapore.html","",0,20,150);

slide show code below
<HTML>
<BODY bgcolor="#000000" text="#FFFFFF" onload="javascript:{if(parent.frames[0]&&parent.frames['menuFrame'].Go)parent.frames['menuFrame'].Go()}">
<table align="center">
<script language="JavaScript1.2">

/*Multi image slideshow script- by javascriptkit.com
Visit JavaScript Kit (http://javascriptkit.com) for script
Credit must stay intact for use*/

//#1 SPECIFY number of slideshows
var number_of_slideshows=10

//#2 SPECIFY interval between slide (2000=2 seconds)
var interval=2000

//#3 SHOULD each slide be linked to a unique URL?
var linked=1

var slideshows=new Array(number_of_slideshows)
for (i=0; i <number_of_slideshows; i++)
slideshows[i]=new Array()

//#4 SPECIFY image paths of 1st slideshow
slideshows[0][0]='../america/sugarloaf/sugarloaf00.jpg'
slideshows[0][1]='../america/sugarloaf/sugarloaf01.jpg'
slideshows[0][2]='../america/sugarloaf/sugarloaf02.jpg'
slideshows[0][3]='../america/sugarloaf/sugarloaf03.jpg'
slideshows[0][4]='../america/sugarloaf/sugarloaf04.jpg'
slideshows[0][5]='../america/sugarloaf/sugarloaf05.jpg'
slideshows[0][6]='../america/sugarloaf/sugarloaf06.jpg'
slideshows[0][7]='../america/sugarloaf/sugarloaf07.jpg'
slideshows[0][8]='../america/sugarloaf/sugarloaf08.jpg'
//SPECIFY image paths of 2nd slideshow (remove if number_of_slides less than 2)
slideshows[1][0]='../america/Niagra/Niagra01.jpg'
slideshows[1][1]='../america/Niagra/Niagra02.jpg'
slideshows[1][2]='../america/Niagra/Niagra03.jpg'
slideshows[1][3]='../america/Niagra/Niagra04.jpg'
slideshows[1][4]='../america/Niagra/Niagra05.jpg'
slideshows[1][5]='../america/Niagra/Niagra06.jpg'
slideshows[1][6]='../america/Niagra/Niagra07.jpg'

//SPECIFY image paths of 3rd slideshow (remove if number_of_slides less than 3)
slideshows[2][0]='../america/Philadelphia/Philadelphia01.jpg'
slideshows[2][1]='../america/Philadelphia/Philadelphia02.jpg'
slideshows[2][2]='../america/Philadelphia/Philadelphia03.jpg'
slideshows[2][3]='../america/Philadelphia/Philadelphia04.jpg'
slideshows[2][4]='../america/Philadelphia/Philadelphia05.jpg'
slideshows[2][5]='../america/Philadelphia/Philadelphia06.jpg'

//EXTEND THIS ARRAY if more than 3 slide shows

slideshows[3][0]='../america/Dallas/Dallas01.jpg'
slideshows[3][1]='../america/Dallas/Dallas03.jpg'
slideshows[3][2]='../america/Dallas/Dallas04.jpg'
slideshows[3][3]='../america/Dallas/Dallas05.jpg'
slideshows[3][4]='../america/Dallas/Dallas06.jpg'
slideshows[3][5]='../america/Dallas/Dallas07.jpg'

//EXTEND THIS ARRAY if more than 3 slide shows

slideshows[4][0]='../america/california/california01.jpg'
slideshows[4][1]='../america/california/california02.jpg'
slideshows[4][2]='../america/california/california03.jpg'
slideshows[4][3]='../america/california/california04.jpg'
slideshows[4][4]='../america/california/california05.jpg'
slideshows[4][5]='../america/california/california06.jpg'
slideshows[4][6]='../america/california/california07.jpg'

//EXTEND THIS ARRAY if more than 3 slide shows

slideshows[5][0]='../america/providence/providence01.jpg'
slideshows[5][1]='../america/providence/providence02.jpg'
slideshows[5][2]='../america/providence/providence03.jpg'
slideshows[5][3]='../america/providence/providence04.jpg'

//EXTEND THIS ARRAY if more than 3 slide shows

slideshows[6][0]='../america/plymouth/plymouth01.jpg'
slideshows[6][1]='../america/plymouth/plymouth02.jpg'
slideshows[6][2]='../america/plymouth/plymouth03.jpg'
slideshows[6][3]='../america/plymouth/plymouth04.jpg'

//EXTEND THIS ARRAY if more than 3 slide shows

slideshows[7][0]='../america/boston/boston01.jpg'
slideshows[7][1]='../america/boston/boston10.jpg'
slideshows[7][2]='../america/boston/boston11.jpg'
slideshows[7][3]='../america/boston/boston14.jpg'
slideshows[7][4]='../america/boston/Boston04.jpg'
slideshows[7][5]='../america/boston/Boston05.jpg'
slideshows[7][6]='../america/boston/Boston07.jpg'
slideshows[7][7]='../america/boston/Boston08.jpg'

//EXTEND THIS ARRAY if more than 3 slide shows

slideshows[8][0]='../america/white_mountains/newhamp01.jpg'
slideshows[8][1]='../america/white_mountains/newhamp07.jpg'
slideshows[8][2]='../america/white_mountains/newhamp10.jpg'
slideshows[8][3]='../america/white_mountains/newhamp13.jpg'
slideshows[8][4]='../america/white_mountains/newhamp14.jpg'
slideshows[8][5]='../america/white_mountains/newhamp15.jpg'

//EXTEND THIS ARRAY if more than 3 slide shows

slideshows[9][0]='../america/NewYork/centralpark.jpg'
slideshows[9][1]='../america/NewYork/empirestate.jpg'
slideshows[9][2]='../america/NewYork/lib.jpg'
slideshows[9][3]='../america/NewYork/neon.jpg'
slideshows[9][4]='../america/NewYork/skyline.jpg'
slideshows[9][5]='../america/NewYork/statu_1.jpg'
slideshows[9][6]='../america/NewYork/view.jpg'

<!--Remove the below portion if "var linked" above is set to 0-->

var slidelinks=new Array(number_of_slideshows)
for (i=0; i <number_of_slideshows; i++)
slidelinks[i]=new Array()

//#5 SPECIFY urls of 1st slideshow
for (i=0; i< 9; i++)
slidelinks[0][i]='../america/sugarloaf/sugarloaf.html'

//SPECIFY urls of 2nd slideshow (remove if number_of_slides=1)
for (i=0; i< 6; i++)
slidelinks[1][i]='../america/Niagra/niagra.html'

//SPECIFY urls of 3rd slideshow (remove if number_of_slides less than 3)
for (i=0; i< 5; i++)
slidelinks[2][i]='../america/Philadelphia/Philadelphia.html'

//SPECIFY urls of 3rd slideshow (remove if number_of_slides less than 3)
for (i=0; i< 5; i++)
slidelinks[3][i]='../america/Dallas/dallas.html'

//SPECIFY urls of 3rd slideshow (remove if number_of_slides less than 3)
for (i=0; i< 6; i++)
slidelinks[4][i]='../america/california/california.html'

//SPECIFY urls of 3rd slideshow (remove if number_of_slides less than 3)
for (i=0; i< 4; i++)
slidelinks[5][i]='../america/providence/providence.html'

//SPECIFY urls of 3rd slideshow (remove if number_of_slides less than 3)
for (i=0; i< 4; i++)
slidelinks[6][i]='../america/plymouth/plymouth.html'

//SPECIFY urls of 3rd slideshow (remove if number_of_slides less than 3)
for (i=0; i< 7; i++)
slidelinks[7][i]='../america/boston/boston.html'

for (i=0; i< 5; i++)
slidelinks[8][i]='../america/white_mountains/white_mountains.html'

for (i=0; i< 6; i++)
slidelinks[9][i]='../america/NewYork/ny.html'

function clickredir(){
window.location=slidelinks[maininc][subinc]
}

<!-- END removal ---------------------------------->

var maininc=0
var subinc=0

if (linked)
document.write('<a href="javascript:clickredir()"><img src="'+slideshows[0][0]+'" name="multislide" border=0></a>')
else
document.write('<img src="'+slideshows[0][0]+'" name="multislide">')

function slideit(){
subinc= (subinc<slideshows[maininc].length-1)? subinc+1: 0
document.images.multislide.src=slideshows[maininc][subinc]
}

function setslide(which){
clearInterval(runit)
maininc=which
subinc=0
runit=setInterval("slideit()",interval)
}

runit=setInterval("slideit()",interval)

</script>

<p align="center">
- <a href="javascript:setslide(0)">SugarLoaf Maine 2002-2004</a><br>
- <a href="javascript:setslide(1)">Niagra Falls USA Feb 2004</a><br>
- <a href="javascript:setslide(2)">Philadelphia PA USA Feb 2004</a><br>
- <a href="javascript:setslide(3)">Dallas TX USA Nov 2003</a><br>
- <a href="javascript:setslide(4)">California USA Feb 2002</a><br>
- <a href="javascript:setslide(5)">Providence RI USA Feb 2002</a><br>
- <a href="javascript:setslide(6)">Plymouth MA USA Feb 2002</a><br>
- <a href="javascript:setslide(7)">Boston MA USA 2000-2001</a><br>
- <a href="javascript:setslide(8)">White Mountains Nh USA Oct 2001</a><br>
- <a href="javascript:setslide(9)">New York NY USA Apr 2001</a><br>
</p>

</table>
</BODY>
</HTML>

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: demonmaestro and 122 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.