;(function($){ $.extend($.fn, { freeze: function(opts) { var params = $.extend({ 'unfreeze': false }, opts); return this.each(function() { // This won't work in some versions of Android. // http://code.google.com/p/android/issues/detail?id=5491 // http://code.google.com/p/android/issues/detail?id=4549 var freeze = function(e){ e.preventDefault(); }; if (params.unfreeze) { $(this).off('touchmove', freeze); } else { $(this).on('touchmove', freeze); } }); } }); })(Zepto);