Results 1 to 4 of 4

Thread: Animated Rollovers

  1. #1
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Animated Rollovers

    Is it possible to make animated rollovers on JavaScript?How?

  2. #2
    Join Date
    May 2007
    Location
    USA
    Posts
    373
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default

    Code:
    <img src="test.bmp" alt="" 
    onmouseover="(function(img){img.src='test2.bmp'})(this)" 
    onmouseout="(function(img){img.src='test.bmp'})(this)" 
    />

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Trinithis View Post
    Code:
    <img src="test.bmp" alt="" 
    onmouseover="(function(img){img.src='test2.bmp'})(this)" 
    onmouseout="(function(img){img.src='test.bmp'})(this)" 
    />
    Why so complicated?

    HTML Code:
    <img alt="..." src="..." onmouseover="this.src = '...';" onmouseout="this.src = '...';">
    There are more scalable approaches, but this is fine for a few instances.
    Mike

  4. #4
    Join Date
    May 2007
    Location
    USA
    Posts
    373
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default

    I forgot about using non-functions.

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
  •