PDA

View Full Version : Help with a menu and picture gallery script



Aradon
09-20-2004, 06:01 AM
I have just installed and customised a top nav menu and slide show gallery, but i need help with the links, is it possible to set the target destination for links within script or can they only load in the main page?

I would like to have my links load into an I Frame but the regular

target="iframe"

Code doesnt work. The scripts are:

1) Top Navigational Bar II
2) DHTML slideshow script

any help would be great.

Thanks
Aradon

ddadmin
09-20-2004, 06:25 PM
Firstly, you'll need to give the iframe an ID attribute, such as:


<iframe src="test.htm" id="myiframe"></iframe>
With that done, try this:

1) For Top Navigational Bar 2 (http://www.dynamicdrive.com/dynamicindex1/topnavbar.htm) , replace the actual URLs inside your js file, such as:


"about.htm"
with a JavaScript URL such as:


javascript:document.getElementById('myiframe').src='about.htm'
This should execute a JavaScript command to load about.htm in the iframe instead.

2) For DHTML Slide Show (http://www.dynamicdrive.com/dynamicindex14/dhtmlslide.htm) , modify the function:


function transport(){
window.location=photoslink[which]
}
to:


function transport(){
document.getElementById('myiframe').src= photoslink[which]
}
I haven't tested either of the above, but theorically they should work.

P.S: In the future, please follow the following format when posting a question, namely, always posting a link to the script(s) in question like I've done above: http://www.dynamicdrive.com/forums/showthread.php?t=6 Don't post the entire source code here.

Aradon
09-21-2004, 05:45 AM
Thank you very much for your help, the solution for the DHTML Slideshow Gallery (http://www.dynamicdrive.com/dynamicindex14/dhtmlslide.htm) works a treat but im not sure on the Top Navigational Bar (http://www.dynamicdrive.com/dynamicindex1/topnavbar.htm) one this part


dhtmlMenu = new NavBarMenu(100, 0);
dhtmlMenu.addItem(new NavBarMenuItem("Home", ""));
myNavBar1.addMenu(dhtmlMenu);

is where the menu items are displayed and linked arent they??

Where do i put the code you suggested? I know you said to replace the link


"about.htm"

But i did that and the menu didnt appear at all!!

Thanks again