PDA

View Full Version : Invert function in Ultimate Fade-in slideshow (v1.51)



boombari
05-04-2008, 10:31 AM
hi to all,

i have installed this script http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm ...

it's very nice ! But i need to invert the mouseover function:

I want to start the slideshow on mouse over, and stop it on mouse out ...how can u do ?

Thanks ! :)

Nile
05-04-2008, 09:18 PM
In the script, on one of the last lines(in the javascript), you'll see this:


crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}

Change that to this:


crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=0}

And that should work. :)
Hope this Helps,
Nile

boombari
05-05-2008, 08:00 AM
nice !

Thanks :)

Another tips :D ...if i want to start the slideshow, out of script ...for example, from an external href ?
How can i call the start function ? :)

PS: excuse me for my english ! :D

boombari
05-05-2008, 10:03 AM
nile, excuse me, ...but your suggest not works :(

jscheuer1
05-05-2008, 03:07 PM
Nile's idea worked for me, but to prevent the slide show from running at the beginning, I found I needed to also add (red):


function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
if(!obj.mouseinit)
obj.mouseinit=obj.mouseovercheck=1;
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}

And remember, pause must be enabled here:


new fadeshow(fadeimages, 140, 225, 0, 3000, 1)

To unpause the show from a link or button, you can use the fadearray[] instance invoked by its number. The first show on a page is 0, the second one (if used) is 1, and so on (ex for the first slide show on a page):


fadearray[0].mouseovercheck=0;

to start the show and:


fadearray[0].mouseovercheck=1;

to stop it. Example using HTML a tag:


<a href="#" onclick="fadearray[0].mouseovercheck=0;return false;">Go</a>

Or even a toggle:


<a href="#" onclick="fadearray[0].mouseovercheck=!fadearray[0].mouseovercheck;return false;">Pause/Resume</a>