View Full Version : Fade-in Image Slide Show Question

09-19-2005, 02:13 AM
Fade-in Image Slideshow

Can this script be made to open links in separate custom sized windows, and how can this be done?

Thanks in advance.

09-19-2005, 03:19 AM
Yes, it can be done in a number of ways, I'm sure. I picked this method -

Find this line in the script:

var tempcontainer=fadeimages[i][1]!=""? '<a href="'+fadeimages[i][1]+'" target="'+fadeimages[i][2]+'">' : ""Change it to this:

var tempcontainer=fadeimages[i][1]!=""&&fadeimages[i][1]!="#"? '<a href="'+fadeimages[i][1]+'" target="'+fadeimages[i][2]+'">' : fadeimages[i][1]=="#"? '<a href="'+fadeimages[i][1]+'" onclick="'+fadeimages[i][2]+'">' : ""Once you've done that, you can enter something like this:

fadeimages[0]=["photo1.jpg", "#", "window.open('http://www.google.com', '', 'width=300, height=250');return false;"]In the fade images array. Notice the # sign in the link field. It is a flag that tells the added code to treat this link differently. With that flag, it tells the script to use this:

window.open('http://www.google.com', '', 'width=300, height=250');return false;that is entered in what usually is the target field, as an onclick event. You can use any valid form of the window.open() method here that you like (no unescaped double quotes, use single quotes for simplicity's sake, as in my example). You could even put a function call here, as long as you define the function elsewhere on the page.

09-19-2005, 04:37 AM
Thanks heaps... that worked a treat. :)