...

View Full Version : Add Target tag to Slideshow to accomodate Frame ID



Stowt
08-01-2006, 02:18 AM
I'm looking to use this script to link from the picture slidshow to a thumbnail view, I have it working on the individual .html page, however am calling it in a frameset. I've tried appending a target tag into the gotoshow function but apparently am not doing something right. Is there any way to manipulate this code to accomodate living within frames? The frame ID where the main content lives is "right" so the target command in HTML ends up target="right".

Here is the code. Please let me know if I can provide any further information to help in troubleshooting. I have the code hosted if you need the link.

Thanks in advance - Stowt

<head>
<script language="JavaScript1.1">
<!--

//specify interval between slide (in mili seconds)
var slidespeed=3000

//specify images
var slideimages=new Array("pic1.jpg","pic2.jpg","pic3.jpg")

//specify corresponding links
var slidelinks=new Array("link1.html", "link2.html", "link3.html")

var newwindow=0 //open links in new window? 1=yes, 0=no

var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}

//-->
</script>

</head>
<body>
<a href="javascript:gotoshow()"><img src="pic1.jpg" name="slide" border="0" style="filter:blendTrans(duration=3)" width="260" height="198"></a>

<script language="JavaScript1.1">
<!--

var whichlink=0
var whichimage=0
var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 : 0
function slideit(){
if (!document.images) return
if (ie) document.images.slide.filters[0].apply()
document.images.slide.src=imageholder[whichimage].src
if (ie) document.images.slide.filters[0].play()
whichlink=whichimage
whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0
setTimeout("slideit()",slidespeed+blenddelay)
}
slideit()

//-->
</script>
</body>

felgall
08-01-2006, 03:44 AM
You may want to replace

window.location=slidelinks[whichlink]


with

window.location=right.slidelinks[whichlink]

Stowt
08-01-2006, 05:51 PM
Thanks for the follow up! :thumbsup:

I went and tried to make the update, however I get an error on the page upon clicking that states "'right' is undefined".

I'm beginning to think that maybe I should rewrite their site to remove the framesets and just make it a simple table instead...

vwphillips
08-01-2006, 06:05 PM
window.top.right.location=slidelinks[whichlink]

Stowt
08-01-2006, 09:13 PM
That worked perfect VWPhillips! :thumbsup:

Thanks to both of you for your replies and help :o



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum