Image Rollover Stuff - HTML Noob!

by simmonsmike7 4 replies
I tried google-ing this stuff for hours but can't find what I am looking for, probably because i am such an HTML noob :p

Here's what I want to do, it's very simple.

I have one image. When someone clicks on that image, another bigger image appears. Both images are different files, so its not just enlarging the first one, its showing a new image when the old one is clicked.

I used to know how to do this, but I forgot the code - thank you in advance if someone helps me out
#main internet marketing discussion forum #html #image #noob #rollover #stuff
Avatar of Unregistered
  • Profile picture of the author gxd5
    <script language="Javascript">
    if (document.images) {
    button2 = new Image
    button2.src = 'img2.gif'
    <a href="" onClick="document.clickme.src=button2.src"><img src="img1.gif" border=0 name="clickme"></a>
    {{ DiscussionBoard.errors[684684].message }}
  • Profile picture of the author simmonsmike7
    hey man that worked well but what happens is it only shows the 2nd image for a quick second and then the second image goes away. you have to click the 1st image again for the 2nd one to appear, and only for a quick second.

    is there a way to make the second image stay and not go away within 1 second?
    EverTrust Media is the leading digital marketing agency.
    {{ DiscussionBoard.errors[684922].message }}
  • Profile picture of the author gxd5
    My bad, I just threw that up without testing it. Here is a one line version that I have tested in Firefox 3:

    <img onClick="this.src='two.jpg';" src="one.jpg" border=0>
    {{ DiscussionBoard.errors[684976].message }}
  • Profile picture of the author UcDog
    i had leave u a pm ... pls reply me asap ty
    {{ DiscussionBoard.errors[2729757].message }}
Avatar of Unregistered

Trending Topics