JavaScript DHTML/jQuery/dblclick — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 13:02, 26 мая 2010
To bind a "Hello World!" alert box the dblclick event on every paragraph on the page:
<source lang="html4strict">
<html>
<head> <script type="text/javascript" src="js/jquery-1.3.2.js"></script> <script type="text/javascript"> $(document).ready(function(){
var divdbl = $("div"); divdbl.dblclick(function () { divdbl.toggleClass("dbl"); });
}); </script>
<style>
div.dbl { background:yellow;color:black; }
</style>
</head> <body> <body>
asdf
Double click the block
</body>
</html>
</source>