PDA

View Full Version : stop rotating I Frame on mouseover


LWilhelm
07-31-2003, 10:27 PM
Hello,

Any one know how to get the following script
to stop/pause rotation on mouseover and
resume onmouse out?



<IFRAME name="rotate" id="rotate" src="ad_folder/ad1.html" scrolling="no" framespacing="0" frameborder="0" marginwidth="2" marginheight="1" border="0" style="width:211px; height:335px"></IFRAME>

<SCRIPT language="JavaScript" type="text/javascript">
<!--// Pages to rotate
var pages=new Array('ad_folder/ad1.html', 'ad_folder/ad2.html', 'ad_folder/ad3.html');
var rint=10; // Rotation interval
var currentpage=-1;
function rotator(){
currentpage++;
if(currentpage >= pages.length) currentpage=0;
document.all.rotate.src=pages[currentpage];
setTimeout('rotator()', rint * 1000);
}
rotator();
//-->
</SCRIPT>

Horus_Kol
08-01-2003, 03:22 AM
hi,

This kind of thing is better off in the Client Side forum.


in the IFRAME, put in the following attributes:

onmouseover='stop_rot()'
onmouseout='resume_rot()'


and put in the necessary javascript in those functions.

LWilhelm
08-01-2003, 06:37 PM
Note to Horus_Kol:

Thanks for your help, I thought I was in the client side
forum.
You said to put:
onmouseover='stop_rot()'
onmouseout='resume_rot()'

in the IFRAME. :Like This?

<IFRAME name="rotate" id="rotate" src="ad_folder/ad1.html" onmouseover='stop_rot()'onmouseout='resume_rot()'
scrolling="no" framespacing="0" frameborder="0" marginwidth="2" marginheight="1" border="0" style="width:211px; height:335px"></IFRAME>


And you said "put in the necessary javascript in those functions".

what do you mean??? :confused