Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Import Javascript effect into html body

Reply
Thread Tools

Import Javascript effect into html body

 
 
Viabug123
Guest
Posts: n/a
 
      04-21-2006
I have an effect of changing images in javascript. When mouse over
image1, it changes to image2.
But I don't know how to import the above javascript effect in the body
of html, so that I can design the html page. There is no function of
<body onmouseover="function();...>. Could anyone suggest me any ideas
to solve it? Thanks a lot.


onMouseOver="handlePress();return true;"
onMouseUp="handleRelease();return true;"
....
if (document.images) {
img_on =new Image(); img_on.src ="image/1.gif";
img_off=new Image(); img_off.src="image/2.gif";
}

function handlePress() {
if (document.images) document.imgName.src=img_on.src;
}

function handleRelease() {
if (document.images) document.imgName.src=img_off.src;
}

 
Reply With Quote
 
 
 
 
Neredbojias
Guest
Posts: n/a
 
      04-21-2006
To further the education of mankind, "Viabug123" <(E-Mail Removed)>
vouchsafed:

> I have an effect of changing images in javascript. When mouse over
> image1, it changes to image2.


Do you want it to change back to image1 when you mouseout? If so, you
could use just css.

> But I don't know how to import the above javascript effect in the body
> of html, so that I can design the html page. There is no function of
> <body onmouseover="function();...>. Could anyone suggest me any ideas
> to solve it? Thanks a lot.


Your javascript examples were very old and outdated. Best check with the
newsgroup "comp.lang.javascript" for advice. What you want to do is
actually pretty simple but you need to know something about the current
DOM.

--
Neredbojias
Infinity has its limits.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To reduce your body weight & slim your body Loss weight MCSA 0 07-23-2007 07:54 PM
To reduce your body weight & slim your body Loss weight MCSA 0 07-21-2007 05:15 AM
How to read the BODY of HTML file from another HTML file using javascript? Dhanasankar S via DotNetMonster.com ASP .Net 1 02-28-2005 05:51 PM
How to read the BODY of HTML file from another HTML file using javascript? Dhanasankar S via DotNetMonster.com ASP .Net 0 02-26-2005 10:58 AM
is there a way to import *.html file to message.body dude718 ASP .Net 3 08-01-2003 08:23 AM



Advertisments