SEO Software
Closed Thread
Results 1 to 5 of 5

Thread: Rollover using JS

  1. #1
    Mr. BindasS ankur0412 is on a distinguished road ankur0412's Avatar
    Join Date
    Feb 2009
    Location
    India
    Posts
    717
    Thanks
    24
    Thanked 54 Times in 42 Posts
    Blog Entries
    2

    Default Rollover using JS

    Is there a way of implementing roll over images using javascript....?


  2. SEO Software

  3. #2
    Fresh Meat Zoli is on a distinguished road Zoli's Avatar
    Join Date
    Jan 2009
    Location
    Veszpr?m, Hungary
    Posts
    29
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default

    When you would like to change the displayed image roll over you may use this function
    HTML Code:
    <img src="1.jpg" onmouseover="this.src='2.jpg'" alt="" />

  4. #3

    Default

    Follow-up to Zoli's reply:
    Probably you would need to add the onmouseout to change back your image to the original source. I.e.:
    HTML Code:
    <img src="1.jpg" onmouseover="this.src='2.jpg'" onmouseout="this.src='1.jpg'" alt="" />
    2WDH.com .:. Professional Hosting since 2003

  5. #4

    Default

    Quote Originally Posted by 2WDH.com View Post
    Follow-up to Zoli's reply:
    Probably you would need to add the onmouseout to change back your image to the original source. I.e.:
    HTML Code:
    <img src="1.jpg" onmouseover="this.src='2.jpg'" onmouseout="this.src='1.jpg'" alt="" />
    Thanks for this code. It is helpful for me also...

  6. #5

    Default

    You would need to paste the following code in <HEAD></HEAD> tags.

    <script language="Javascript">
    <!--
    //Slide Show script (this notice must stay intact)


    if (document.images) {
    button1 = new Image
    button2 = new Image

    button1.src = 'img1.gif'
    button2.src = 'img2.gif'
    }
    //-->
    </script>
    After that you can use this code in <BODY></BODY> tags

    <a href="yourwebsite" onmouseover="document.rollover.src=button2.src" onmouseout="document.rollover.src=button1.src"><im g src="img1.gif" border=0 name="rollover"></a>
    I hope, it will be helpful for you.

Closed Thread

Similar Threads

  1. Rollover buttons
    By FelipeMelo in forum Design and Development
    Replies: 4
    Last Post: 06-08-2008, 12:09 PM
  2. Rollover Images
    By dotsLagedesse in forum Design and Development
    Replies: 7
    Last Post: 06-08-2008, 12:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts