JSFiddle - React, Tailwind, and code Playground

by yijiang

HTML

<link rel="stylesheet" href="http://dl.dropbox.com/u/1722364/jsfiddle.css">
<h1>New York, Orlando join anti-TSA rebellion, TSA mounts PR effort</h1>    
<p>New York City officials are working to ban the TSA's privacy-busting  full-body scanners, while an Orlando airport announces plans to fire the  TSA and hire private security instead. Meanwhile, the TSA release a  list of "myths" vs. "facts" about the scanners and pat-downs.</p>

CSS

h1 {
    color: #666;
}

p {
    color: orange;
}

JavaScript

console.log($('h1').css('color'));
console.log($('p').css('color'));


$('h1, p').hover(function(){
    var colorString = $(this).css('color');
    rgb = colorString.substring(4, colorString.length - 1).split(',');
    
    var newColor = 'rgb(' + 
        (parseInt(rgb[0], 10) - 40) + ',' + 
        (parseInt(rgb[1], 10) - 40) + ',' +
        (parseInt(rgb[2], 10) - 40) + ')';
    
    $(this).css('color', newColor);
}, function(){
    $(this).css('color', '');
});