Skip to content

Instantly share code, notes, and snippets.

@jimmybot
Created July 12, 2015 13:38
Show Gist options
  • Save jimmybot/ab00a9704c913bb87ce0 to your computer and use it in GitHub Desktop.
Save jimmybot/ab00a9704c913bb87ce0 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
font-family: monospace;
}
ul {
list-style: none;
}
li {
background-color: #9FF;
width: 8em;
font-size: 2em;
padding: 2em;
margin: 2em;
}
li.original {
background-image: img(adsfadsfads.png);
}
li.new{
background-image: img(newimage.png);
}
</style>
</head>
<body>
<ul id="menu">
<li id="green" class="item">it</li>
<li id="two" class="item">ji</li>
<li id="three" class="item">san</li>
</ul>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
var previous_label = "";
$(".item").hover(
function(e) {
previous_label = $(this).text();
$(this).text($(this).attr('id'));
},
function(e) {
$(this).text(previous_label);
}
);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment