Assume your CSS looks like:
color: rgb(255, 0, 0);
To retrieve the color property of the
var color = window.getComputedStyle(
Passing the pseudo-element as the second argument to
window.getComputedStyle allows access to said pseudo-element styles! Keep this snippet in your toolbox for years to come -- pseudo-elements will only grow more useful with broader browser support!
I get asked loads of questions every day but I'm always surprised that they're rarely questions about code or even tech -- many of the questions I get are more about non-dev stuff like what my office is like, what software I use, and oftentimes...
I work with an awesome cast of developers at Mozilla, and one of them in Daniel Buchner. Daniel's shared with me an awesome strategy for detecting when nodes have been injected into a parent node without using the deprecated DOM Events API.
Fellow DZone Zone Leader Boyan Kostadinov wrote a very useful article detailing how you can add a...
jQuery offers a quick event shortcut method called hover that accepts two functions that represent mouseover and mouseout actions. Here's how to implement that for MooTools Elements.
We implement hover() which accepts to functions; one will be called on mouseenter and the other...