You may add a global variable to keep the ID of your setTimeout. Then, use that variable to clearTimeout() when onmouseover, but setTimeout() again when onmouseout.
//example
var t
t = setTimeout("slide()", 2500);
//in function when onmouseover
function mover() {
clearTimeout(t) // not sure if you need window.clearTimeout()
}
//in function when onmouseout
function mout() {
t = setTimeout("slide()", 2500)
}
Taywin
Posting Virtuoso
1,727 posts since Apr 2010
Reputation Points: 229
Solved Threads: 239
Hi Aze, try this ....
<head>
<title>HTML ders | 09.07.2010</title>
<script>
onload = function() {
sekil = [ "bir.jpg", "iki.jpg", "uc.jpg", "dord.jpg", "bes.jpg" ];
sekil.x = 0;
sekil.allowSlide = true;
sekil.tim = null;
sekil.slide = function() {
if( !document.images || !sekil.allowSlide ) { return; }
clearTimeout(sekil.tim);
document.images.az.src = sekil[sekil.x];
document.getElementById('caption').innerHTML = sekil[sekil.x];
sekil.x = ++sekil.x % 5;
sekil.slideDelay();
}
sekil.slideDelay = function() {
sekil.tim = setTimeout(function(){sekil.slide();}, 2500);
}
document.images.az.onmouseover = function(){ sekil.allowSlide = false; }
document.images.az.onmouseout = function(){ sekil.allowSlide = true; sekil.slide(); }
sekil.slideDelay();
};
</script>
</head>
<body>
<img name="az" src="bir.jpg" width="250" height="200">
<div id="caption">bir.jpg</div>
</body>
</html>
Airshow
Airshow
WiFi Lounge Lizard
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372