View Full Version : Fade-in image slideshow ? add mouseover PAUSE

10-28-2005, 05:09 PM
I have the Fade-in image slideshow and think it is great but would like to be able to PAUSE the image with a mouseover... Is this possible and what do I need to add to do this without destroying this great script.

Thank you
Joe Connell
aka joevideo

10-28-2005, 05:59 PM
Add this line (in red) to the declared variables, a little ways down in the part of the script you are not supposed to edit:

var curpos=10
var degree=10
var curcanvas="canvas0"
var curimageindex=0
var nextimageindex=1
var stop=0

Add this (in red) to the insertimage function:

function insertimage(i){
var tempcontainer=fadeimages[i][1]!=""? '<a href="'+fadeimages[i][1]+'" target="'+fadeimages[i][2]+'">' : ""
tempcontainer+='<img onmouseover="stop=1;" onmouseout="stop=0; rotateimage();" src="'+fadeimages[i][0]+'" border="0">'
tempcontainer=fadeimages[i][1]!=""? tempcontainer+'</a>' : tempcontainer
return tempcontainer

Add this (in red) to the rotateimage function:

function rotateimage(){
if (stop)
if (ie4||dom){
var crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
var temp='setInterval("fadepic()",50)'
curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
curimageindex=(curimageindex<fadeimages.length-1)? curimageindex+1 : 0

10-28-2005, 06:08 PM

I DID read the first line in your reply... the script you are not supposed to edit:

So before I start, should I get SOMEONE's permission to make this change?
All it states in the top of the script is:
//Fade-in image slideshow- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

??? what would you do is what my final question is?

and Thanks for the quick reply
I was hoping it would be you !!

Joe Connell
aks joevideo

10-28-2005, 06:37 PM
I have deleted (will) my last post because.. [RE: 2 different scripts]
:eek: gee... what was I looking at... it has what you stated and it does work

Now before I USE it, I will TRY to contact SOMEONE to get permission to make this change to the script...

Any ideas who to contact to get permission?

Thanks John !!! You are a true Pirate (PA)
(you do live there don't you?)
Joe Connell
aka joevideo

10-28-2005, 08:44 PM
Don't worry about using the modified script. I know it is fine with DD. If it wasn't, I would have heard about it long ago. In fact, the reverse is true, DD has been very supportive of my efforts in these forums. Just keep the credit intact. You might add to it:

//Fade-in image slideshow- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use
//Modified here for mouseover pause by jscheuer1
//in http://www.dynamicdrive.com/forums

As far as being a Pirate, is concerned, I think you are referring to the other (Pittsburgh) end of the state. I am a big Baseball Fan though. The Phillies are the home town team around here. Very exciting this year, they just missed the wildcard by a half game to Houston. Perhaps they may have made a better showing than those Astros against the White Sox but, man were those White Sox hot!

10-28-2005, 08:58 PM
Thanks John for the info
I will add the revised credit IF I decide to use the altered script.
You see I tried it out and it SEEMED to work OK...
but when you go back and forth with your mouse over the image
IE tends to go wacko and even causes a freeze/shutdown
try it with this example:
http://www.westernfluidyne.com/products_SSp.html (www.westernfluidyne.com/products_SSp.html)

Not sure if it is worth the change, unless we needed something more to prevent this???

RE: PA and baseball
I figured you would be on the other side of PA
and just be glad you don't have Tigers to root for :rolleyes:

Thanks for all your help

Joe Connell
aka joevideo

10-28-2005, 09:55 PM
No... now it doesn't Re-Start the fade to next image.

Think maybe we need to change order of red and blue..??

function rotateimage(){
if (stop)
if (ie4||dom){

Sorry, I am fairly good at HTML but scripts are not my cup of Jack

Did it work for you when you tried it?
I could send you the FTP log in to download file (off list)
gee. he's a trusting sole ! :(

But time is $$ and I'm not getting any $$ to pay you for your time.

Guess I need to get a Java Book and do some reading on this one

Thanks again

10-29-2005, 05:25 AM
Geez, you are quick. I deleted that post shortly after I published it, as I soon discovered that under extreme abuse I could still get the script to misbehave. I also noticed that on your test page (first mod version only), the pause was not working right, even when I was gentle with it (the show continued for one more change before pausing, I think, or just continued). I almost did not attempt this particular mod because I know the script fairly well going in. It creates two divisions that contain the images in various states of fade that are then swapped with each other over and over to create the slide/fade effect. Because of this, it is very hard to figure out where to stop things. I did that recently for another poster in these forums but, knowing where to restart is a whole other issue as in that previous effort, I created a situation where the script actually was stopped ahead of time and then let to 'run out' to the end. This approach would not work for a mouseover pause though so, it is really back to the drawing board on this one, sorry.

There are slide scripts that use the proprietary IE blendTrans for fade that can pause/resume easily onmouseover/out but, they are just ordinary sliders in other browsers. A 'wizard' that can produce this type of show is at:


10-29-2005, 03:20 PM
RE: quick... yea, a little TOO quick,
I made the last changes and when I went back to double check your info in the post...

. . . . YOU were as quick as I was, it was gone..???
I thought I somehow deleted your post (sure, that's not possible)

But now I think we got it.
Your link to the Slideshow Wizard (http://www.barelyfitz.com/projects/slideshow/wizard/) script has everything anyone could ask for
to create a slide show with fades; pause; re-start... and so much more.

John, I owe you big time on this one. ;)
Check it out everyone... http://www.westernfluidyne.com/products_SS.html


Joe Connell
aka joevideo