UNPKG

jquery.pep.js

Version:

Kinetic drag for mobile & desktop

54 lines (39 loc) 1.26 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>jquery.pep custom functions</title> <!-- Load local jQuery. --> <script src="../libs/jquery/jquery.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> <!-- Load local lib and tests. --> <script src="../src/jquery.pep.js"></script> <script type="text/javascript"> $(document).ready(function(){ var threshold = 30; $('.pep').pep({ initiate: function(ev, obj) { obj.$el.text('initiate'); }, start: function(ev, obj) { obj.$el.text('start'); }, drag: function(ev, obj) { obj.$el.text( obj.$el.text() + '. ') }, stop: function(ev, obj) { obj.$el.text('stop'); }, rest: function(ev, obj) { obj.$el.text('rest'); }, }); }); </script> <style type="text/css"> .pep{ width: 200px; height: 200px; color: white; opacity: 0.8; background: blue; position: absolute; top: 0; left: 0px; } </style> </head> <body> <div class="pep"></div> </body> </html>