Skip to content

Instantly share code, notes, and snippets.

@vquaiato
Created March 26, 2012 18:18
Show Gist options
  • Save vquaiato/2208405 to your computer and use it in GitHub Desktop.
Save vquaiato/2208405 to your computer and use it in GitHub Desktop.
hover images and p
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$(".icone-chat").mouseover(function(){
var data = $(this).attr("data");
var p = "#" + data;
$(p).toggleClass('com-destaque');
}).mouseout(function(){
var data = $(this).attr("data");
var p = "#" + data;
$(p).toggleClass('com-destaque');
});
});
</script>
<style>
p{color:#333;}
.com-destaque{color:red;}
</style>
</head>
<body>
<span class="icone-chat" data="foo">passa o mouse aew</span>
<p id="foo">UMA DESCRICAO AEW</p>
<p>UMA DESCRICAO AEW</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment