Created
August 25, 2015 15:24
-
-
Save tranquangchau/ed6a6dbdf9f9ad69d895 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 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
Nô nê: