kneidels
asked on
Javascript image slideshow activated with onMouseOver/Out
hey folks
i have the following JS slide show.
the aim is to have a static image display (no changing), until user does a mouse-over it. then it start playing automatically.
onMouseOut, the slideshow should stop, and the image should return to the initial default image.
if possible, there could be a nice fade effect, that i havent managed to get to work.
can anyone take a look at the code and see what might be missing for the above functionality?
thanks!
i will paste
i have the following JS slide show.
the aim is to have a static image display (no changing), until user does a mouse-over it. then it start playing automatically.
onMouseOut, the slideshow should stop, and the image should return to the initial default image.
if possible, there could be a nice fade effect, that i havent managed to get to work.
can anyone take a look at the code and see what might be missing for the above functionality?
thanks!
i will paste
<script>
var iCount = 0;
var aImages = new Array();
aImages[0] = 'images/sample/4.jpg';
aImages[1] = 'images/sample/5.jpg';
aImages[2] = 'images/sample/6.jpg';
aImages[3] = 'images/sample/17.jpg';
function slideShow(){
document.slideShowImage.src = aImages[iCount];
iCount ++;
if (iCount >= aImages.length){
iCount = 0;
//setTimeout('slideShow()', 1000);
}else{
slideShowImage.filters.blendTrans.apply();
setTimeout('slideShow()', 1000);
slideShowImage.filters.blendTrans.play();
}
}
function slideShowOut(){
iCount = 3;
}
</script>
<img src="images/sample/6.jpg" name="slideShowImage" id="slideShowImage" onmouseover="javascript:slideShow();" onmouseout="javascript:slideShowOut()" style="filter:blendTrans(duration=3)" />
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
excellent, thanks!
ASKER
hi again
i just rteid it out again - i seem to get a "undefined" image (ie, the image is a red X and right clicking to see properties says undefined)at some point in the lopp when i just leave my mouse over the image.
any ideas?
Thanks!
i just rteid it out again - i seem to get a "undefined" image (ie, the image is a red X and right clicking to see properties says undefined)at some point in the lopp when i just leave my mouse over the image.
any ideas?
Thanks!
Not sure - how does your array of images look and the first image you use?
Do you have a URL?
Do you have a URL?
Open in new window