 |
 User: Login | Is a collection of industrial-grade JavaScript utilities and widgets that enable you to efficiently get the most out of today’s powerful web applications. News and Articles about Designing and Developing wiht Yahoo! Libraries. |
| Address URL | http://yuiblog.com/blog Registered: 26-Apr-2008 |
| Ads: | |
Send to email | A Style All Their Own in Development | By Luke Smith el 12-Jun-2008 | Modifying a DOM element’s style during user interaction is one of the
pillars of creating DHTML interfaces that transition from state to state in a
smooth, and (hopefully) intuitive way. Every HTMLElement in the DOM
contains style, a collection of properties corresponding to the
CSS properties understood by the browser. For JavaScript and CSS enabled browsers, the following two paragraphs would contain red text:
<-- Paragraph 1 -->
<p style="color: #f00">This paragraph is red</p>
<-- Paragraph 2 -->
<p id="x">This paragraph's color will be red after the JavaScript runs</p>
<script type="text/javascript">
(function () {
var el = document.getElementById('x');
el.style.color = ‘#f00′;
})();
</script>
Even CSS properties that aren’t applicable to a given element will have representation in that element’s style collection. For example, even the <br> element will have the el.style.letterSpacing property.
Names have been changed to protect the innocent
The style property names in JavaScript are camel cased versions of their CSS
counterparts, so font-family in CSS becomes
el.style.fontFamily in the style collection. "float" is a reserved word in
JavaScript, so the CSS float property is given a different name. In Internet
Explorer, styleFloat is used, where Firefox, Safari, and Opera all
use cssFloat (Opera also supports styleFloat, actually). Additionally, each browser has a host of proprietary CSS properties that also show up in the style collection (e.g. -moz-border-radius, which becomes el.style.MozBorderRadius in Firefox). Other than styleFloat/cssFloat, the browser vendors largely agree on non-proprietary property names.
The madness and the method
I set out to document which properties were present in each A Grade browser’s style collection (making no claims about their functional support for specific values).
For each browser, I used a simple for (var prop in el.style) method to iterate the style collection, and cross checked in a development tool if available. Specifically, I used the following:
| Browser |
Method |
| Internet Explorer 6 |
for ( in ) and Visual Web Developer 2008 Express Edition |
| Internet Explorer 7 |
for ( in ) and Visual Web Developer 2008 Express Edition |
| Firefox 2.0.0.14 |
for ( in ) and FireBug 1.1 |
| Firefox 3 (Release Candidate 2) |
for ( in ) and FireBug 1.1 |
| Safari 3.1.1 (WebKit build 4525.18) |
Dom Inspector* |
| Opera 9.27 |
for ( in ) |
| Opera 9.5 (beta - build 4808) |
for ( in ) and Opera Dragonfly |
* - Safari does not enumerate unassigned style properties, so for ( in ) doesn’t show anything useful.
All tests were done on a Macbook Pro running OSX 10.4. The IEs and FF2 were tested on Parallels instances running Windows XP. I only documented properties that weren’t prefixed with a vendor identifier (e.g. -moz), and omitted methods and meta fields such as setProperty and length. The only exception to this being cssText, which I’ll talk more about later. So without further ado…

Click through to see the full table of CSS properties.
(more…)
Read 5 times

|
|
 |
 |
 | Yahoo User Interface Blog | Blogger | Is a collection of industrial-grade JavaScript utilities and widgets that enable you to efficiently get the most out of today’s powerful web applications. Yahoo! User Interface Blog News and Articles about Designing and Developing wiht Yahoo! Libraries. |
| A Style All Their Own | | Modifying a DOM element’s style during user interaction is one of the
pillars of creating DHTML interfaces that transition from state to state in a
smooth, and (hopefully) intuitive way. Every HTMLElement in the DOM
contains style, a collection of properties corresponding to the
CSS properties understood by the browser. For JavaScript and CSS enabled browsers, the [...] [..] Read complete article |  | Published 12-Jun-2008 by Luke Smith in Development Read 5 times. More hits in  |
|
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
| Why Does Pikachu Look So Content? [Pokemon] | | I mean...I knew Pokemon bred. It's a staple of the series. But, you know...I always thought it was Nintendo-style breeding, which just happens. Not real-style breeding, where...urgh. Full pic is after the jump, not b [..] Read complete article |  | Published 30-Apr-2008 by Luke Plunkett in CultureNintendoPikachuPokemon Read 2 times. More hits in ![Images about Why Does Pikachu Look So Content? [Pokemon]](./images/photo.gif) |
|
 | Nerdblog | Blogger | Provides news about hardware, software, notebooks, laptops, PCs, Mac, PDAs Nerdblog.Net |
| Make your own arcade-style game gun | This Instructables shows how one gamer built his own FPS gun for playing Halo 2 and Deus Ex on his big screen home entertainment system.
FPS arcade style gun
[Read this article] [Comment on this article] MakeZine.com [..] Read complete article |  | Published 12-Apr-2008 by Nerdblog in General Read 8 times. More hits in  |
|
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
| The Lolita Animal Zoo Game Thing [Only In Japan] | | Odin Sphere developer Vanillaware's latest offering Kumatanchi features a Lolita-style bear-girl named Kuma-tan who puts on shows at the zoo with other Lolita-style critters that include a sexy cow, hot tiger and foxy bunny. Finally! A game that bring [..] Read complete article |  | Published 19-Sep-2008 by Brian Ashcraft in Only in Japan Ds Japan Kumatanchi Oddities odin sphere Read 1 times. More hits in ![Images about The Lolita Animal Zoo Game Thing [Only In Japan]](./images/photo.gif) |
|
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
 | Nerdblog | Blogger | Provides news about hardware, software, notebooks, laptops, PCs, Mac, PDAs Nerdblog.Net |
| Are you ready for WW2-style energy rationing? | | Bring your own gas mask
Analysis Environment Minister Hilary Benn again rebuffed calls this week for WW2-style energy rationing to return to the UK. He was responding to a Select Committee report urging ministers to issue 45 million Britons with an energy trading “credit card” - a mammoth techno-bureaucratic exercise costing several billions of pounds a [...] [..] Read complete article |  | Published 29-May-2008 by Nerdblog in General Read 3 times. More hits in  |
|
 | Kotaku`s The Gamers Guide | Blogger | XBOX 360 Gamers Weblog
Gossip, news and leaks for obsessive gamers Kotaku As if you don't waste enough of your time in a gamer's haze, here's Kotaku: a gamer's guide that goes beyond the press release. Gossip, cheats, criticism, design, nostalgia, pred |
 | Joystiq | Blogger | Covers video game news from an independent, unbiased perspective Joystiq Joystiq |
 | Yahoo User Interface Blog | Blogger | Is a collection of industrial-grade JavaScript utilities and widgets that enable you to efficiently get the most out of today’s powerful web applications. Yahoo! User Interface Blog News and Articles about Designing and Developing wiht Yahoo! Libraries. |
| Applying Matt Galvin?s ?XP-style? Skin to YUI TabView | YUI community member Matt Galvin of Simplified Complexity has been working on some new skins for YUI. He’s early in the process, but it’s not too early to start taking advantage of his work — he’s starting with an XP-style theme and he’s applied it to the YUI Button Control and YUI TabView Control.
Here’s how [...] [..] Read complete article |  | Published 11-Apr-2008 by Eric Miraglia in DevelopmentMatt GalvinSimplified ComplexitySkinningTabViewyui Read 9 times. More hits in  |
|
 | Nerdblog | Blogger | Provides news about hardware, software, notebooks, laptops, PCs, Mac, PDAs Nerdblog.Net |
 | Nerdblog | Blogger | Provides news about hardware, software, notebooks, laptops, PCs, Mac, PDAs Nerdblog.Net |
 | Nerdblog | Blogger | Provides news about hardware, software, notebooks, laptops, PCs, Mac, PDAs Nerdblog.Net |
|
Warning We are not responsible of information posted from external feeds. Use this website at your own risk.
Notice: We will not be liable for any direct or indirect loss or damage arising under this disclaimer or in connection with our website, whether arising in tort, contract, or otherwise.
|
|
| |