+ Reply to Thread
Results 1 to 10 of 10

Thread: How to make mouseover codes

  1. #1
    Album is offline x10 Sophmore Album is an unknown quantity at this point
    Join Date
    Aug 2005
    Location
    Michigan
    Posts
    174

    How to make mouseover codes

    isn't there a type of code you can use to make it so that when someone moves the cursor over a link or a image, it'll change?

    Can someone please teach me what the code for this is?

    example: There is a button (button.jpg) and I want for it to change to button2(button2.jpg) when someone's cursor is on top of it . How can I make this possible?

  2. #2
    clareto is offline x10 Sophmore clareto is an unknown quantity at this point
    Join Date
    Oct 2005
    Posts
    125

    Re: How to make mouseover codes

    You can do it with Javascript or Css

    If you want javascript, Macromedia Dreamweaver MX generates a good code.
    Css can do the same, I really dont know how implemented is it in recent browsers.

    I did found useful information making the google search "css image rollover tutorial"

  3. #3
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: How to make mouseover codes

    You will need to use event attributes in HTML.

    Give me a few minutes so I can get you the few lines of code.

  4. #4
    mattspec's Avatar
    mattspec is offline x10 Elder mattspec is an unknown quantity at this point
    Join Date
    Aug 2005
    Location
    Kitchener, Ontario, Canada
    Posts
    693

    Re: How to make mouseover codes

    javascript is a really easy way of doing it, its all ove if you just want to google it




  5. #5
    Album is offline x10 Sophmore Album is an unknown quantity at this point
    Join Date
    Aug 2005
    Location
    Michigan
    Posts
    174

    Re: How to make mouseover codes

    Yeah thanks guys.
    I found this site on google and i think this'll work

    http://www.mompswebdesign.com/html/mouseover.html

  6. #6
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: How to make mouseover codes

    Sorry I had to get off for a bit.. I see you found a way to do it.

    I was going to give you this:

    Code:
    
    <script type="text/javascript">
    
    
    // For each set of images, add these lines, incrementing each number at the end of the line for the pair.
    image1 = new Image();
    image1.src = "image_on.gif";
    
    image2 = new Image();
    image2.src = "image_off.gif";
    
    </script>
    
    
    <a href="html.html" onmouseover="document.scrollover1.src=image1.src" onmouseout="document.scrollover1.src=image2.src">
    <img src="image_off.gif" name="scrollover1">
    </a>

  7. #7
    Album is offline x10 Sophmore Album is an unknown quantity at this point
    Join Date
    Aug 2005
    Location
    Michigan
    Posts
    174

    Re: How to make mouseover codes

    Thanks NedrevN

    That also helps since thats a slightly different way of doing it

  8. #8
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: How to make mouseover codes

    Yep. Your welcome. :-D

    They basically are the same thing.. lol.
    Last edited by Bryon; 11-24-2005 at 10:58 PM.

  9. #9
    clareto is offline x10 Sophmore clareto is an unknown quantity at this point
    Join Date
    Oct 2005
    Posts
    125

    Re: How to make mouseover codes

    mmm... I've tried with the macromedia preload images function, and using the trick to put the images with 1px width and height, or putting them in an invisible layer. In fact, the rollover works, but the status bar of the browser says "transferring data from .... ", or "waiting for...". I think a small rollover may become a big bandwith eater!!!

  10. #10
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: How to make mouseover codes

    Once the image loads, it *should* be cached by the browser, thus not loading over and over again everytime you "scroll over" the image.

    Also, the way I have the scrollover images set up preloads the images already. :-D

+ Reply to Thread

Similar Threads

  1. Your Website Needs
    By IamShipon1988 in forum Graphics & Webdesign
    Replies: 14
    Last Post: 06-21-2010, 07:47 AM
  2. Make these pictures look catoonish
    By SEŅOR in forum The Marketplace
    Replies: 10
    Last Post: 03-08-2006, 11:02 AM
  3. Can anyone make me a banner or two
    By Kay in forum The Marketplace
    Replies: 12
    Last Post: 12-22-2005, 08:11 PM
  4. Make A Cool Advanced Brushed Sig
    By redtailblackshark in forum Tutorials
    Replies: 34
    Last Post: 10-22-2005, 07:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers