Hi, I worked to build a custom rotator banner, The rotator is working fine, but my client need to pause the rotation when the user mouseover the banner.
help me with this setTimeout() error
3
Hi,
I worked to build a custom rotator banner, The rotator is working fine, but my client need to pause the rotation when the user mouseover the banner.
Here is the code i used,
var t;
function rotate_banner(){
var x = new Array("m_top","m_middle","m_middle","m_bottom");
for(i=1; i<=4;i++){
t = setTimeout("get_offer('"+ i +"','" + x[i-1] + "')",i*3000);
}
setTimeout("rotate_banner()",12000);
}
window.onload =rotate_banner();
By this function the rotator is working fine, but when i call another function when mouse over the banner pause_rotate().
function pause_rotate(){
clearTimeout(t);
t=0;
}
This function is not clearing the timeout, Please any one help me to stop the rotator when mouse over the banner.
Thanks.
I worked to build a custom rotator banner, The rotator is working fine, but my client need to pause the rotation when the user mouseover the banner.
Here is the code i used,
var t;
function rotate_banner(){
var x = new Array("m_top","m_middle","m_middle","m_bottom");
for(i=1; i<=4;i++){
t = setTimeout("get_offer('"+ i +"','" + x[i-1] + "')",i*3000);
}
setTimeout("rotate_banner()",12000);
}
window.onload =rotate_banner();
By this function the rotator is working fine, but when i call another function when mouse over the banner pause_rotate().
function pause_rotate(){
clearTimeout(t);
t=0;
}
This function is not clearing the timeout, Please any one help me to stop the rotator when mouse over the banner.
Thanks.
- phpg
- [1] reply
- Earnie Boyd
Next Topics on Trending Feed
-
3