2012-01-26 16:11:16 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>jQuery UI Interaction - Default functionality</title>
|
|
|
|
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
|
2012-07-06 19:19:47 +00:00
|
|
|
<script src="../../jquery-1.7.2.js"></script>
|
2012-01-26 16:11:16 +00:00
|
|
|
<script src="../../ui/jquery.ui.core.js"></script>
|
|
|
|
<script src="../../ui/jquery.ui.widget.js"></script>
|
|
|
|
<script src="../../ui/jquery.ui.interaction.js"></script>
|
|
|
|
<link rel="stylesheet" href="../demos.css">
|
|
|
|
<style>
|
|
|
|
#startmovestop { width: 200px; height: 100px; background: lightBlue; }
|
|
|
|
</style>
|
|
|
|
<script>
|
|
|
|
$(function() {
|
2012-01-28 02:11:22 +00:00
|
|
|
$.widget( "demo.startmovestop", $.ui.interaction, {
|
2012-01-26 16:11:16 +00:00
|
|
|
_start: function() {
|
2012-01-28 02:11:22 +00:00
|
|
|
$( "#startcount" ).text(function( i, current ) {
|
|
|
|
return parseInt( current, 10 ) + 1;
|
2012-01-26 16:11:16 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
_move: function() {
|
2012-01-28 02:11:22 +00:00
|
|
|
$( "#movecount" ).text(function( i, current ) {
|
|
|
|
return parseInt( current, 10 ) + 1;
|
2012-01-26 16:11:16 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
_stop: function() {
|
2012-01-28 02:11:22 +00:00
|
|
|
$( "#stopcount" ).text(function( i, current ) {
|
|
|
|
return parseInt( current, 10 ) + 1;
|
2012-01-26 16:11:16 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2012-01-28 02:11:22 +00:00
|
|
|
|
2012-01-26 16:11:16 +00:00
|
|
|
$( "#startmovestop" ).startmovestop();
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div class="demo">
|
|
|
|
|
|
|
|
<div id="startmovestop"></div>
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>Start:</dt>
|
|
|
|
<dd id="startcount">0</dd>
|
|
|
|
<dt>Move:</dt>
|
|
|
|
<dd id="movecount">0</dd>
|
|
|
|
<dt>Stop:</dt>
|
|
|
|
<dd id="stopcount">0</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
</div><!-- End demo -->
|
|
|
|
|
|
|
|
|
|
|
|
<div class="demo-description">
|
|
|
|
<p>This demo shows a simple interaction built using the interaction utility (jquery.ui.interaction.js).</p>
|
|
|
|
<p>Make a down-move-up motion starting on the blue box above using the mouse or a touch input device to see the interaction events</p>
|
|
|
|
</div><!-- End demo-description -->
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|