From 7380e1d40bf11086270d2268205558badf577b33 Mon Sep 17 00:00:00 2001 From: chicpro Date: Thu, 24 Oct 2013 08:59:04 +0900 Subject: [PATCH] =?UTF-8?q?=ED=83=AD=20=EB=84=93=EC=9D=B4=EB=A5=BC=20outer?= =?UTF-8?q?Width=20=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/shop.mobile.main.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/js/shop.mobile.main.js b/js/shop.mobile.main.js index 36edbe633..50d20cb25 100644 --- a/js/shop.mobile.main.js +++ b/js/shop.mobile.main.js @@ -60,7 +60,7 @@ $tabs.each(function() { $(this) .css("width", $(this).width()) - .data("width", $(this).outerWidth()); + .data("width", $(this).width()); }); $btns.on("click", function() { @@ -87,8 +87,10 @@ $slides.not("."+cfg.active_class).css("left", "-"+width+"px"); + set_tab_width(idx); + if(count == 1) { - tab_width = $tabs.eq(0).data("width"); + tab_width = $tabs.eq(0).outerWidth(); pos_left = parseInt((tabw_width - tab_width) / 2); $tabs.eq(0).css("left", pos_left).addClass(cfg.tab_active); } else if(count == 2) { @@ -102,8 +104,6 @@ $slides.eq((idx - 1)).css("left", "-"+width+"px"); $slides.eq((idx + 1) % count).css("left", width+"px"); } - - set_tab_width(idx); } function swipe_left() @@ -128,14 +128,14 @@ $slides.eq(next).css("left", width+"px"); $tabs.removeClass(cfg.tab_active); + set_tab_width(next); + if(count >= 3) { tab_position(next); } else { $tabs.eq(next).addClass(cfg.tab_active); } - set_tab_width(next); - $slides.eq(idx).clearQueue().animate( { left: "-="+width }, cfg.duration, function() { @@ -178,14 +178,14 @@ $slides.eq(next).css("left", "-"+width+"px"); $tabs.removeClass(cfg.tab_active); + set_tab_width(next); + if(count >= 3) { tab_position(next); } else { $tabs.eq(next).addClass(cfg.tab_active); } - set_tab_width(next); - $slides.eq(idx).clearQueue().animate( { left: "+="+width }, cfg.duration, function() { @@ -220,8 +220,8 @@ var $tab_l = $tabs.eq(idx - 1); var $tab_c = $tabs.eq(idx); var $tab_r = $tabs.eq((idx + 1) % count); - var w_c = $tab_c.data("width"); - var w_r = $tab_r.data("width"); + var w_c = $tab_c.outerWidth(); + var w_r = $tab_r.outerWidth(); var pl = 0; var pc = parseInt((tabw_width - w_c) / 2);