Help - Search - Members - Calendar
Full Version: Javascript Over Css In Css Guide?!
W3Schools Forum > W3Schools > Suggestions
Daniel-Dane
Why not use ":hover" instead of javascript? It IS the CSS section...

http://www.w3schools.com/Css/css_image_transparency.asp
Deirdre's Dad
:hover on elements that are not <a> elements doesn't work on IE6 at all (I think) and only works on IE7 with a strict doctype. A lot of new designers don't use any doctype or use a transitional doctype. This way they can see the effect no matter what.

That said, showing both options might be a good idea.
Daniel-Dane
Come on... enough with IE6. IE8 is out! Just put a damn note saying it won't work with outdated browsers.
Ingolme
The reason they use Javascript instead of CSS is because their examples don't have a Doctype declaration, therefore :hover wouldn't work in Internet Explorer 7.

I don't develop for Internet Explorer 6, but it's wise to continue developing for Internet Explorer 7. It's just fine to use the :hover pseudo-class but you must make sure you're using a Strict DTD to make it work in Internet Explorer 7.
Daniel-Dane
Then add a doctype.
Ingolme
QUOTE (Daniel-Dane @ Jun 1 2009, 07:30 PM) *
Then add a doctype.

The tryit editors use the <iframe> element. The <iframe> element isn't part of the HTML or XHTML Strict DTDs, they have to use Transitional.
roundcorners
It's easy to say don't use ie6, but many people are still using it. It really depends on your audience.
Let's face it if you are a commercial developer you need to be aware of the large portion of users who still use ie6.
Many businesses lock down the admin rights on their networks, meaning individuals cannot upgrade to the latest browser and the company does not want to spend the resources on upgrading every computer.
So even if the end customer is able to use FF 3, internally, the departments testing the sites are using older browsers and don't particularly care that it looks perfect in FF 3 because they can't click on any of the anchors or the text is flying off the side of the window.

Developers can be very arrogant, if you are hired to do a job, whatever that job is, you must do it as well as you can, even if that means lowering your standards to supporting...dare I say...IE6

In a perfect world we'd all be using attribute selectors and pseudo classes on the body tag, but it ain't so deal with it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.