FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Help with image on a page

 


pollux1er
Hi to everybody. I wnated to know how to realize an image which change on mouse over it. Thanks to help me.
SamiTheBerber
For image is the easiest to make it:
<div id="changethis"><img onmouseover="change('this.jpg', 'new.jpg');" ... /></div>

After that, you must make the change-function:
function change(this, new) {
document.getElementById('changethis').innerHTML = "<img onmouseover=\"change('" + new + "','" + this + "');\" ... />";

I color coded the code so it would be easy for you to follow it. The code should work, but I haven't tested it. It works in theory Wink
pollux1er
SamiTheBerber wrote:
For image is the easiest to make it:
<div id="changethis"><img onmouseover="change('this.jpg', 'new.jpg');" ... /></div>

After that, you must make the change-function:
function change(this, new) {
document.getElementById('changethis').innerHTML = "<img onmouseover=\"change('" + new + "','" + this + "');\" ... />";

I color coded the code so it would be easy for you to follow it. The code should work, but I haven't tested it. It works in theory Wink


Thank you for that code. It seems to be workin. Anyway, after trying it, i will tell you if it wors.
pollux1er
I hope it is javascript... Wink
SamiTheBerber
pollux1er wrote:
I hope it is javascript... Wink
Yes, it is JavaScript Smile
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.