Created
April 28, 2012 14:41
-
-
Save wilornel/2519550 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
<html> | |
<head> | |
<script src='jquery.js'></script> | |
<script> | |
$(document).ready(function(){ | |
// When hovered | |
$('#leftTab').on('mouseenter', '.starImg', function(){ | |
console.log('asdasd'); | |
this.src = 'images/stardown.png'; | |
}).on('mouseleave', '.starImg', function(){ | |
this.src = 'images/starup.png'; | |
console.log('mouseleave'); | |
}); | |
// When clicked | |
$('.starImg').live('click', function(){ | |
$(this).on('mouseleave', function(event){ event.stopPropagation(); }); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<div class="star" rel="9"> // When the user clicks this, it sends an ajax Request to the server | |
<img class="starImg" src="images/starup.png"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment