Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 01-02-2005, 02:14 PM   #1 (permalink)
 
Junior Techie

Join Date: May 2004

Posts: 95

unbornzodiac

Default mouse over image

Can someone help me with the html code for inserting an image and when mouseover it turns into another image, and is also a link? I can't seem to get it right. Thanks.
unbornzodiac is offline  
Old 01-02-2005, 02:49 PM   #2 (permalink)
 
Junior Techie

Join Date: Dec 2004

Posts: 88

developer

Default

<html>
<head>
<title>Image Change</title>
</head>
<script language="javascript">
function change()
{
myimg.src="gif/5.gif"
}
</script>
<body>

[img]gif/4.gif[/img]

</body>
<html>

You can use property onMouseOut, onMouseDown etc as you want, in a similar fashion.
__________________
Somewhere I Belong...
developer is offline  
Old 01-02-2005, 03:06 PM   #3 (permalink)
 
Junior Techie

Join Date: May 2004

Posts: 95

unbornzodiac

Default

Works perfect! Thanks!
unbornzodiac is offline  
Old 01-02-2005, 10:03 PM   #4 (permalink)
 
Newb Techie

Join Date: Dec 2004

Posts: 2

unseen

Send a message via AIM to unseen
Default

im a noob to programming, but i got a ? where do you enter all this info.?
unseen is offline  
Old 01-06-2005, 02:57 PM   #5 (permalink)
 
Junior Techie

Join Date: Dec 2004

Posts: 88

developer

Default

The above code is a self contained HTML doc. The script is where we keep all our functions. language attribute tells the browser about the lang the functions are written in. Similarly we have scripts run at server with runat="server" attribute.

The rest in the script is simple javascript and is very similar to C/C++. We define a func, which is called when the mouse is taken over the part of the web form, for whom we have given a unique name. On this it changes the source of the image via the javascript function.
__________________
Somewhere I Belong...
developer is offline  
 
Closed Thread

Thread Tools
Display Modes

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 On