;(function($){ $.extend($.fn, { mask: function(opts) { var params = $.extend({ 'unmask': false, 'freeze': 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.unmask) { if (params.freeze) { $(this).find('.mask').off('touchmove', freeze); } $(this).find('.mask').remove(); } else { if ($(this).find('.mask').size() === 0) { $(this).append('
'); if (params.freeze) { $(this).find('.mask').on('touchmove', freeze); } } } }); } }); })(Zepto);