help needed..

liunx

Guest
hey,<br />
<br />
I'm not too good with html, what i need is when someone hovers over an image it changes to another one..<br />
<br />
Like i would want someone to see this image: <!-- m --><a class="postlink" href="http://www.animechatforums.com/templates/DefconBlue/images/Index/defconpreview_r4_c11.jpg">http://www.animechatforums.com/template ... r4_c11.jpg</a><!-- m --> and when they hover over it, it changes to this: <!-- m --><a class="postlink" href="http://www.animechatforums.com/templates/DefconBlue/images/Index/homeover.jpg">http://www.animechatforums.com/template ... meover.jpg</a><!-- m --> <br />
<br />
So basically it would look like the colour has changed..Anyone know the coding for this?<br />
<br />
Cheers..<!--content-->Hi there Zeph,<br />
<br />
Welcome to these forums,<br />
Try this for your problem...<br />
<br />
<img src=http://www.htmlforums.com/archive/index.php/"first.jpg" alt="" onmouseover="this.src='second.jpg'" /><br />
<br />
c:D:Dthead<!--content-->Originally posted by coothead <br />
<br />
<img src=http://www.htmlforums.com/archive/index.php/"first.jpg" alt="" onmouseover="this.src='second.jpg'" /><br />
<br />
<br />
I guess you'll want the image to turn back to normal when the cursor is no longer over the image, so:<br />
<br />
<img src=http://www.htmlforums.com/archive/index.php/"first.jpg" alt="" onmouseover="javascript: this.src='second.jpg'" onmouseout="javascript: this.src='http://www.htmlforums.com/archive/index.php/first.jpg'"/><br />
<br />
Remember to remove the extra space the forums adds between 'java' and 'script'.<!--content-->Hey guys, thanks very much!<br />
<br />
That works a treat.. :)<br />
<br />
Another Q tho..why the need for javascript there? As it works fine without it..<!--content-->Originally posted by Zeph <br />
<br />
Another Q tho..why the need for javascript there? As it works fine without it.. <br />
<br />
Heh, good question.. Actually I don't know enough about it.. I just do it out of habit.. It just seems logical that you'd need to identify the script-language you're using. I didn't find any offical docs on it, but maybe somebody knows the specs.<!--content-->
 
Back
Top