PDA

View Full Version : Link only specific images in Blending Slide Show



kdumas
11-15-2008, 06:06 PM
1) Script Title: Blending Image Slideshow

2) Script URL (on DD): http://dynamicdrive.com/dynamicindex14/image4.htm

3) Describe problem:
I have the slideshow working fine. I want to link the last image ONLY. However, on all the preceding images, it still links to a blank page. Is there a way to not have the preceding images clickable at all?

Here are both scripts as I have them configured now:

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

//*****************************************
// Blending Image Slide Show Script-
// Dynamic Drive (www.dynamicdrive.com)
// For full source code, visit http://www.dynamicdrive.com/
//*****************************************

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

//specify images
var slideimages=new Array("image1.gif","stats.gif","image2.gif","image3.gif","image4.gif","image5.gif","image6.gif","image7.gif","image8.gif","image9.gif","theend.jpg")

//specify corresponding links
var slidelinks=new Array("","","","","","","","","","","mailto:email@comcast.net")

var newwindow=1 //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>



<table width="873" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="219">&nbsp;</td>
<td width="472">
<p align="center"><img src="transparent.gif" width="50" height="146"><a href="javascript:gotoshow()"><img src="image1.gif" name="slide" width=472 height=342 border=0 style="filter:blendTrans(duration=3)"></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>
</p>

</td>
<td width="182">&nbsp;</td>
</tr>
</table>

jscheuer1
11-15-2008, 06:36 PM
Change this:


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

to:


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

With that, you may use empty items to denote no link here:


var slidelinks=new Array("http://www.dynamicdrive.com","","http://www.geocities.com")

The second (of three in this case) image would have no link.