From 024721770c89d7e1429b502ccc90ebe025c0600f Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 1 Oct 2013 11:27:04 +0900 Subject: [PATCH] =?UTF-8?q?=ED=94=8C=EB=A1=9C=ED=8C=85=EB=A9=94=EB=89=B4?= =?UTF-8?q?=EC=97=90=EC=84=9C=20touchstart=20=EC=9D=B4=EB=B2=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/jquery.floatmenu.js | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/js/jquery.floatmenu.js b/js/jquery.floatmenu.js index cac9862dd..f8480bdcf 100644 --- a/js/jquery.floatmenu.js +++ b/js/jquery.floatmenu.js @@ -5,7 +5,7 @@ timeout: 200, duration: 300, interval: 500, - count: 10 + count: 5 }; if(typeof timeout == "object") { @@ -66,9 +66,10 @@ function hide_menu() { + $menu.css("display", "none").clearQueue().stop().css("top", "-"+height+"px"); + clearTimeout(timeout); clearInterval(interval); - $menu.css("display", "none").clearQueue().stop().css("top", "-"+height+"px"); interval_count = 0; interval = setInterval(check_menu, cfg.interval); @@ -106,22 +107,17 @@ }); $(window).on("resize", function(event) { - float_menu(); + if(origin_y != scroll_y) + float_menu(); }); $(window).on("load", function(event) { init_menu(); }); - $(window).on("touchstart", function(event) { + $(window).on("touchmove", function(event) { hide_menu(); }); - - if(navigator.userAgent.toLowerCase().indexOf("android") > -1) { - $(window).on("touchmove", function(event) { - hide_menu(); - }); - } } $.fn.bottomFloatMenu = function(timeout, duration, interval, count) @@ -130,7 +126,7 @@ timeout: 200, duration: 300, interval: 500, - count: 10 + count: 5 }; if(typeof timeout == "object") { @@ -205,9 +201,10 @@ function hide_menu() { + $menu.css("display", "none").css("top", (w_height + height)+"px").clearQueue().stop(); + clearTimeout(timeout); clearInterval(interval); - $menu.css("display", "none").css("top", (w_height + height)+"px").clearQueue().stop(); interval_count = 0; interval = setInterval(check_menu, cfg.interval); @@ -256,17 +253,12 @@ }); $(window).on("resize", function(event) { - float_menu(); + if(origin_y != scroll_y) + float_menu(); }); - $(window).on("touchstart", function(event) { + $(window).on("touchmove", function(event) { hide_menu(); }); - - if(navigator.userAgent.toLowerCase().indexOf("android") > -1) { - $(window).on("touchmove", function(event) { - hide_menu(); - }); - } } }(jQuery)); \ No newline at end of file