Created
March 3, 2011 20:25
-
-
Save benfoxall/853468 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.5.js"></script> | |
<style type="text/css" media="screen"> | |
body{font-family: Helvetica, sans-serif} | |
</style> | |
<script type="text/javascript" charset="utf-8"> | |
$(function(){ | |
$('p#a').mouseenter(function(){ | |
$(this).css('color','#fc0') | |
}) | |
$('p#b').mouseenter(function(){ | |
$(this).css('color','#08f') | |
}) | |
$('p').mouseleave(function(){ | |
$(this).css('color','#000') | |
}) | |
$('button').click(function(){ | |
$.event.trigger('mouseenter') | |
}) | |
}) | |
</script> | |
</head> | |
<body> | |
<button>Mouseenter all</button> | |
<p id="a">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> | |
<p id="b">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment