Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding javascript inside body tag?? 1

Status
Not open for further replies.

yandso

Programmer
Jul 20, 2001
278
0
0
US
I have a page with a flash movie in it. I want the movie to finish, then add a onmouseMove event into the body tag. I have already coded the movie to call a function at the appropriate time, I just don't know if I can change the body tag then???
 
sure...something like

var b = document.getElementsByTagName("body")[0];
b.setAttribute("onmousemove", "myFunction();");



=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Jeff,
That was exactly what I was looking for thanks. One question though. It does not appear that the onmouseMove event kicks off after I have added it the tag?
 
alright, this seems to work for me in IE and Moz FB:

var b = document.getElementsByTagName("body")[0];
b.onmousemove = myFunction;



=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
That has done the trick...Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top