Hacker News new | ask | show | jobs
by j79 5891 days ago
There's a huge difference though.

With HTML/CSS/JavaScript, hover events (both the :hover and "onmouseover" event in JavaScript) are typically used for visual feedback (the :hover event being strictly presentation...)

There's a reason for this: Users can disable JavaScript.

A core fundamental of web development (graceful degradation or progressive enhancements) is the result of this. As a developer, you can't assume the "mouseover" event will be available.

Web developers write functional pages first. They then progressively enhance it with JavaScript. This is why the web does (or, theoretically) works (contrary to what you said...)

Flash, on the other hand, is different by nature. It doesn't permit users to disable mouse events (or any other events), from firing. As a Flash developer, you can write code that requires a hover event, with fair confidence that it won't hinder a visitors interaction with the site/project.

To be honest, it's what made Flash so tempting to develop for. You're given an equal playing field through the SWF player.

Unfortunately for Adobe, with Safari/Chrome/FireFox/Opera pushing web standards, HTML5/CSS3/JS are making things (quite) interesting for web developers.

2 comments

"Web developers write functional pages first."

You're confusing best practices with common practices. The vast majority of sites are developed with the assumption that javascript will be enabled in the viewer's browser.

You're right. That's why I included, "This is why the web does (or, theoretically) works..."

To be honest, I know a few developers that develop with the assumption that JavaScript will be enabled. I've also worked at a few companies that assume clients should have JavaScript enabled...

Unfortunately, I see too many sites that completely fall apart if you disable JavaScript (some sites that are even selling a product!)

JavaScript still has a stigma as being a "toy" language and until developers understand/utilize it's full potential, a lot of crummy code will still be written. Thankfully, jQuery (and other great JS libraries) are opening the potential for JavaScript to developers.

Good thing disabling Javascript completely cripples basic CSS selectors... Not.
Some browsers will only respect the :hover pseudo-class on anchors.
IE < 8. Downvoters are missing the point: Graceful degration / progressive enhancement are core parts of the HTML platform, not Flash.