SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Jun 2007
    Posts
    396
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Hover in IE6 on different elements?

    Hi guys,

    I'm trying to hover a listed element in IE6 but of course it doesn't seem to support it I've got this code that I thought would work, but err, it doesn't:

    Code:
    window.onload = function() {
    	var ul = document.getElementById('nav');
    	ul.onmouseenter = ul.onmouseleave = function() {
    		this.className = (event.type == 'mouseenter') ? 'hover' : '';
    	};
    };
    try { document.execCommand('BackgroundColor', false, true); } catch(e) {}
    Any idea what I'm doing wrong please? Many thanks

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.xs4all.nl/~peterned/csshover.html

    csshover.htc is your friend here

  3. #3
    SitePoint Addict
    Join Date
    Jun 2007
    Posts
    396
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ah cheers, yeah I was gonna go with the .htc file but was led to believe there are maybe better ways?

  4. #4
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you use the .htc file, you can also include :active and :focus for keyboard users.

  5. #5
    SitePoint Addict
    Join Date
    Jun 2007
    Posts
    396
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks, couldn't get it working though, no problem; was only an aesthetics issue anyway


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
  •