Created
December 15, 2014 22:34
-
-
Save rcstr/75f341e165461e373ac7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("li .active span", '#list').each(bindEvenToSpan); | |
function bindEvenToSpan(i, elem) { | |
var $this = $(elem); | |
if($this.hasClass('shouldReact')) { | |
$this.on('mouseenter', addCssToSpan); | |
} | |
} | |
function addCssToSpan() { | |
var $this = $(this), | |
content = $this.data('newcontent'); | |
$this.css({ | |
border:'1px solid #cccccc', | |
backgroundImage: 'url("/newbg.png") 10px 36px no-repeat', | |
}).html(content); | |
// persnally i would just create a new class and add the class to the element instead of add the inline css | |
// $this.addClass('superstar'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.superstar { | |
background: url("/newbg.png") 10px 36px no-repeat; | |
border: 1px solid #cccccc; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment