FRIHOST • FORUMS • SEARCH • FAQ • TOS • BLOGS • COMPETITIONS
You are invited to Log in or Register a free 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
Related topics
phbb skin
Google™ API Key?
How to put a page link?
Divs and Tables
Search Engine Optimization some Mistakes
*Live Help Image*
Resize a batch of images
I went the no image route!! What do you think?
Managing page access...
Million Pixel FREE Advt. (New: Paid Pixels Advt. launched)..
250 frih to help increase page rank
Advertising a website - HOWTO?
Layout Contest ~~~200FRIH for winner + more benifits~~~
Pagination of data from an UNION query
I can give 50 frih to help increase page rank
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

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