Skip to content

Instantly share code, notes, and snippets.

@old-campos
Created February 28, 2013 22:18
Show Gist options
  • Save old-campos/5060624 to your computer and use it in GitHub Desktop.
Save old-campos/5060624 to your computer and use it in GitHub Desktop.
A CodePen by Francisco Campos. Double Click jquery
<!DOCTYPE html>
<html>
<head>
<title>Dubba Click</title>
<link rel='stylesheet' type='text/css' href='stylesheet.css'/>
<script type='text/javascript' src='script.js'></script>
</head>
<body>
<div></div>
</body>
</html>
$(document).ready(function() {
$('div').dblclick(function() {
$(this).fadeOut('fast');
});
});
$(document).ready(function() {
$("div").mouseenter(function() {
$("div").fadeTo("fast",1);
$("div").mouseleave(function() {
$("div").fadeTo("fast",0.25);
});
});
});
div {
height: 100px;
width: 100px;
border-radius: 5px;
background-color: #ABCDEF;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment