Image Mouseover Javascript: Stripped Down

Javascript mouseover function has been around for at least eight years now, from somewhere around 1996/7 on. I see a lot of sites (including some of my own) that use Javascript for mouseover functions and decided to try and strip out as much code as I could to try and reduce the redundancy and unnecessary code used to perform such a simple procedure… swapping out an image for another one. Dreamweaver (as an example) is notorious for producing more code than you need.

Be sure to follow the instructions in the iFrame below:

Digg This
November 28, 2005, 1:51 pm

3 Comments »

  1. Rook said,

    December 5, 2005 @ 1:57 pm

    I thought that CSS now has mouseover affects so as to eliminate javascript. But then, I am a snot nosed beginner with all this HTML and CSS coding.

  2. Michael said,

    December 5, 2005 @ 9:18 pm

    Well, it SORTA does, but the purpose of this is to swap out images on a mouseover/out event.

    CSS has certain effects or attributes you can assign to a class or id on mouseover/out (a:hover), but using JavaScript is a bit more efficient and requires less code.

    But for text menus I’d use the a:hover attribute to create that mouseover effect for my text links.

  3. Michael said,

    December 5, 2005 @ 9:18 pm

    BTW, good to “hear” from ya. Long time no chat/see.

RSS feed for comments on this post

Leave a Comment

You must be logged in to post a comment.