PDA

View Full Version : Blending Image Slideshow Script



mrs_gary
07-17-2006, 04:54 PM
1) Script Title: Blending Image Slideshow Script

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

3) Describe problem: Wanting to change the code.

Hi,

I was wondering if there's a way for me to change the code, so it won't automaticly start, but only start when you mouseover the image. Like this:

mouseover image1: fade into image2
mouseover image2: fade into image3

etcetera.

I've tired, but I can't seem to do it right. Is there any other script I have to use?

Thanks in advance

jscheuer1
07-17-2006, 07:02 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">

//*****************************************
// Blending Image Slide Show Script-
// Dynamic Drive (www.dynamicdrive.com)
// For full source code, visit http://www.dynamicdrive.com/
// Modified for mouseover action and Opera 9 compliance in
// http://www.dynamicdrive.com/forums by jscheuer1
//*****************************************

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

//specify images
var slideimages=new Array("image1.gif","image2.gif","image3.gif")

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

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

var imageholder=new Array()
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()" onmouseover="slideit();"><img src="image1.gif" name="slide" border=0 style="filter:blendTrans(duration=3)" width=97 height=100></a>

<script type="text/javascript">

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

</script>

<p align="center"><font face="arial" size="-2">This free script provided by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>
</body>
</html>

mrs_gary
07-18-2006, 03:50 PM
Aaahh thank you! That's actually working! :) THANKS