Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Sunday, January 17, 2016

IE 6 CSS Hover non Anchor Tag

IE 6 CSS Hover non Anchor Tag


What is the simplest and most elegant way to simulate the hover pseudo-class for non-Anchor tags in IE6?

I am specifically trying to change the cursor in this instance to that of a pointer.

Answer by Jon Galloway for IE 6 CSS Hover non Anchor Tag


I think the simplest way is to use the hover.htc approach. You add the hover.htc file to your site, then reference it in your stylesheet:

body { behavior:url("csshover.htc"); }  

If you want to keep things as clean as possible, you can use IE conditional comments so that line is only rendered users with IE6.

Answer by Haacked for IE 6 CSS Hover non Anchor Tag


Another approach, depending on what the item is, is to add a non link anchor and set its display to block. Either put the anchor within or surrounding the item you want the pseudo hover behavior on.

Answer by Benjamin Autin for IE 6 CSS Hover non Anchor Tag


I would say that the simplest method would be to add onmouseover/out Javascript functions.

Answer by YonahW for IE 6 CSS Hover non Anchor Tag


I liked the mouseover/out best since I actually already needed to swap the image anyhow. I really should have thought of doing this with javascript to begin with.

Thanks for the quick answers.

@Joseph

Thanks for that link. I had never heard of this technique before and really like the idea.

I will definitely try that out and see how I fare with it.

Answer by Joseph Pecoraro for IE 6 CSS Hover non Anchor Tag


Aside:

I actually already needed to swap the image anyhow

Make sure you take a look at Image Sprites. Sometimes its much nicer to use one image and "shift" the image then to use two separate images and "toggle" or "swap" between them. In my experience its been much nice when as user interacts with it is sometimes an advantage that there is a single request for the 1 image then multiple requests for multiple images.

Answer by Nathan Peretic for IE 6 CSS Hover non Anchor Tag


Regarding your request -- I am specifically trying to change the cursor in this instance to that of a pointer -- the easiest way is to specify cursor:pointer in your css. I think you will find that works in IE 6.

Try this to verify (where div can be any element):

Hover

Answer by GateKiller for IE 6 CSS Hover non Anchor Tag


If your willing to use JQuery, I would use Set Hover Class for Anything technique.

Answer by Sren Kuklau for IE 6 CSS Hover non Anchor Tag


Another alternative that will fix many more issues in one go is to use IE7.js.


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.