Hi to everybody. I wnated to know how to realize an image which change on mouse over it. Thanks to help me.
Help with image on a page
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
<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
| 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 |
Thank you for that code. It seems to be workin. Anyway, after trying it, i will tell you if it wors.
I hope it is javascript... 
| pollux1er wrote: |
| I hope it is javascript... |
