Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tranquangchau/ed6a6dbdf9f9ad69d895 to your computer and use it in GitHub Desktop.
Save tranquangchau/ed6a6dbdf9f9ad69d895 to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>dblclick demo</title>
<style>
div {
background: blue;
color: white;
height: 100px;
width: 150px;
}
div.dbl {
background: yellow;
color: black;
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<div></div>
<span>Double click the block</span> Calling click on an option element inside a select doesn't update the model
<script>
$('html').dblclick(function (event) {var selObj = window.getSelection();
alert(selObj);});
var divdbl = $( "div:first" );
divdbl.dblclick(function() {
divdbl.toggleClass( "dbl" );
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment