aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/staticfiles/plugins/jquery-ui/demos/draggable/events.html
diff options
context:
space:
mode:
authorAlvin Li <liweitianux@gmail.com>2013-10-09 15:52:53 +0800
committerAlvin Li <liweitianux@gmail.com>2013-10-09 15:52:53 +0800
commit02afd8a32edb13ea7fc2266ac80092ea15c0930c (patch)
treec7a2a3f50378c017b425da47e04a71c6beaae56c /97suifangqa/staticfiles/plugins/jquery-ui/demos/draggable/events.html
parentfafce2cfc72f4e1cd14ff6cb693c8ec7854159c5 (diff)
download97dev-02afd8a32edb13ea7fc2266ac80092ea15c0930c.tar.bz2
* treat 'apps/utils' as regular django app; which used to store
general tools for used in other apps * moved 'templatetags' from 'apps/indicator' to 'apps/utils' * '.gitignore' to ignore 'fixtures_bak' * moved js plugins from 'apps/indicator/static/plugins' to 'staticfiles/plugins' apps/recommend: * updated 'recommend.models'; o commented 'recommend.models.ResearchCombination' (not used) * implemented views 'add_edit_blog_info' and 'ajax_add_edit_configs'; * added pages 'templates/recommend/add_edit_blog_info.html', 'add_edit_blog_info_error.html'; o related css and javascripts files * added 'tools.py'; * added 'utils/tools.py' for placing generic functions; * deleted 'initial_data.json' (mv 'fixtures' to 'fixtures_bak'); * small fixes to 'indicator.models', 'sciblog.models' and 'sfaccount.views' * fixed automatically show 'proper_nouns' annotation in blog: recovered the line 'import signals' in 'sciblog.models' * added 'is_ok()' method for 'recommend.models.ResearchConfig';
Diffstat (limited to '97suifangqa/staticfiles/plugins/jquery-ui/demos/draggable/events.html')
-rw-r--r--97suifangqa/staticfiles/plugins/jquery-ui/demos/draggable/events.html70
1 files changed, 70 insertions, 0 deletions
diff --git a/97suifangqa/staticfiles/plugins/jquery-ui/demos/draggable/events.html b/97suifangqa/staticfiles/plugins/jquery-ui/demos/draggable/events.html
new file mode 100644
index 0000000..d662e88
--- /dev/null
+++ b/97suifangqa/staticfiles/plugins/jquery-ui/demos/draggable/events.html
@@ -0,0 +1,70 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>jQuery UI Draggable - Events</title>
+ <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+ <script src="../../jquery-1.9.1.js"></script>
+ <script src="../../ui/jquery.ui.core.js"></script>
+ <script src="../../ui/jquery.ui.widget.js"></script>
+ <script src="../../ui/jquery.ui.mouse.js"></script>
+ <script src="../../ui/jquery.ui.draggable.js"></script>
+ <link rel="stylesheet" href="../demos.css">
+ <style>
+ #draggable { width: 16em; padding: 0 1em; }
+ #draggable ul li { margin: 1em 0; padding: 0.5em 0; } * html #draggable ul li { height: 1%; }
+ #draggable ul li span.ui-icon { float: left; }
+ #draggable ul li span.count { font-weight: bold; }
+ </style>
+ <script>
+ $(function() {
+ var $start_counter = $( "#event-start" ),
+ $drag_counter = $( "#event-drag" ),
+ $stop_counter = $( "#event-stop" ),
+ counts = [ 0, 0, 0 ];
+
+ $( "#draggable" ).draggable({
+ start: function() {
+ counts[ 0 ]++;
+ updateCounterStatus( $start_counter, counts[ 0 ] );
+ },
+ drag: function() {
+ counts[ 1 ]++;
+ updateCounterStatus( $drag_counter, counts[ 1 ] );
+ },
+ stop: function() {
+ counts[ 2 ]++;
+ updateCounterStatus( $stop_counter, counts[ 2 ] );
+ }
+ });
+
+ function updateCounterStatus( $event_counter, new_count ) {
+ // first update the status visually...
+ if ( !$event_counter.hasClass( "ui-state-hover" ) ) {
+ $event_counter.addClass( "ui-state-hover" )
+ .siblings().removeClass( "ui-state-hover" );
+ }
+ // ...then update the numbers
+ $( "span.count", $event_counter ).text( new_count );
+ }
+ });
+ </script>
+</head>
+<body>
+
+<div id="draggable" class="ui-widget ui-widget-content">
+
+ <p>Drag me to trigger the chain of events.</p>
+
+ <ul class="ui-helper-reset">
+ <li id="event-start" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-play"></span>"start" invoked <span class="count">0</span>x</li>
+ <li id="event-drag" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-arrow-4"></span>"drag" invoked <span class="count">0</span>x</li>
+ <li id="event-stop" class="ui-state-default ui-corner-all"><span class="ui-icon ui-icon-stop"></span>"stop" invoked <span class="count">0</span>x</li>
+ </ul>
+</div>
+
+<div class="demo-description">
+<p>Layer functionality onto the draggable using the <code>start</code>, <code>drag</code>, and <code>stop</code> events. Start is fired at the start of the drag; drag during the drag; and stop when dragging stops.</p>
+</div>
+</body>
+</html>