From 6ed5635e74d8dec2b88ad350e3602e80271e119e Mon Sep 17 00:00:00 2001 From: chicpro Date: Wed, 23 Oct 2013 13:30:15 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=ED=83=AD=EC=83=9D=EC=84=B1=EC=8B=9C=20widt?= =?UTF-8?q?h=20=EC=A7=80=EC=A0=95=ED=95=98=EC=97=AC=20=ED=9A=8C=EC=A0=84?= =?UTF-8?q?=20=ED=9B=84=20=ED=83=AD=20width=20=EB=B3=80=ED=95=98=EB=8A=94?= =?UTF-8?q?=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/shop.mobile.main.js | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/js/shop.mobile.main.js b/js/shop.mobile.main.js index c5d139628..36edbe633 100644 --- a/js/shop.mobile.main.js +++ b/js/shop.mobile.main.js @@ -8,7 +8,8 @@ slide_class: "sidx_slide", active_class: "slide_active", tab_active: "tab_active", - duration: 500 + duration: 500, + width_increase: 10 }; if(typeof option == "object") @@ -33,7 +34,6 @@ var idx = next = 0; var tabw_width = 0; var tab_width = 0; - var li_left = 0; var pos_left = 0; function tab_make() @@ -57,6 +57,12 @@ $tabs = $tab.find("li"); $btns = $tab.find("button"); + $tabs.each(function() { + $(this) + .css("width", $(this).width()) + .data("width", $(this).outerWidth()); + }); + $btns.on("click", function() { tab_click($(this)); }); @@ -82,7 +88,7 @@ $slides.not("."+cfg.active_class).css("left", "-"+width+"px"); if(count == 1) { - tab_width = $tabs.eq(0).outerWidth(); + tab_width = $tabs.eq(0).data("width"); pos_left = parseInt((tabw_width - tab_width) / 2); $tabs.eq(0).css("left", pos_left).addClass(cfg.tab_active); } else if(count == 2) { @@ -96,6 +102,8 @@ $slides.eq((idx - 1)).css("left", "-"+width+"px"); $slides.eq((idx + 1) % count).css("left", width+"px"); } + + set_tab_width(idx); } function swipe_left() @@ -126,6 +134,8 @@ $tabs.eq(next).addClass(cfg.tab_active); } + set_tab_width(next); + $slides.eq(idx).clearQueue().animate( { left: "-="+width }, cfg.duration, function() { @@ -174,6 +184,8 @@ $tabs.eq(next).addClass(cfg.tab_active); } + set_tab_width(next); + $slides.eq(idx).clearQueue().animate( { left: "+="+width }, cfg.duration, function() { @@ -192,6 +204,15 @@ $slides.eq(next).addClass(cfg.active_class); } + function set_tab_width(idx) + { + $tabs.each(function() { + $(this).css("width", $(this).data("width")); + }); + + $tabs.eq(idx).css("width", "+="+cfg.width_increase); + } + function tab_position(idx) { $tabs.removeClass(cfg.tab_actie+" tab_listed tab_left").css("left", "-"+tabw_width+"px"); @@ -199,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.outerWidth(); - var w_r = $tab_r.outerWidth(); + var w_c = $tab_c.data("width"); + var w_r = $tab_r.data("width"); var pl = 0; var pc = parseInt((tabw_width - w_c) / 2); @@ -233,15 +254,10 @@ swipe_left(); } - $(window).on("load", function(e) { + $(window).on("load resize", function(e) { swipe_init(); }); - $(window).on("resize", function(e) { - swipe_init(); - }); - - // swipe event this.swipe({ swipe: function(event, direction, duration, fingerCount) { From 4ab8e9df69083a30cc2409622b62d521147eeee1 Mon Sep 17 00:00:00 2001 From: chicpro Date: Wed, 23 Oct 2013 13:40:13 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=83=81?= =?UTF-8?q?=ED=92=88=EC=9D=B4=20=EC=97=86=EC=9D=84=20=EB=95=8C=20=EC=98=88?= =?UTF-8?q?=EC=99=B8=EC=B2=98=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/jquery.fancylist.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/jquery.fancylist.js b/js/jquery.fancylist.js index 19149bc6f..1fbfb29c5 100644 --- a/js/jquery.fancylist.js +++ b/js/jquery.fancylist.js @@ -18,6 +18,9 @@ var $element = this.find(cfg.element); var $this = this; + if($element.length < 1) + return; + function item_arrange() { var $el = $element.filter(":first"); From cf4a5b6deaa88dcdc6e1e31786e85ec8a7f381e4 Mon Sep 17 00:00:00 2001 From: chicpro Date: Wed, 23 Oct 2013 14:14:28 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EC=86=8D=EB=8F=84=20=ED=96=A5=EC=83=81?= =?UTF-8?q?=EC=9D=84=20=EC=9C=84=ED=95=B4=20=EC=83=81=ED=92=88=EC=83=81?= =?UTF-8?q?=EC=84=B8=20swipe=20sliding=20=EC=95=A0=EB=8B=88=EB=A9=94?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/skin/shop/basic/item.form.skin.php | 69 ++++++----------------- 1 file changed, 17 insertions(+), 52 deletions(-) diff --git a/mobile/skin/shop/basic/item.form.skin.php b/mobile/skin/shop/basic/item.form.skin.php index 39e5e09ae..2e92f6958 100644 --- a/mobile/skin/shop/basic/item.form.skin.php +++ b/mobile/skin/shop/basic/item.form.skin.php @@ -361,14 +361,14 @@ $(function(){ switch(direction) { case "left": - content_slide(direction); + content_swipe(direction); fancyalert("다음 상품이 없습니다."); break; case "right": - content_slide(direction); + content_swipe(direction); fancyalert("이전 상품이 없습니다."); @@ -385,61 +385,26 @@ $(function(){ $("#container").swipe(swipeOptions); }); -function content_slide(direction) +function content_swipe(direction) { // 로딩 레이어 load_message(); + var next_href = ''; + var prev_href = ''; + var str; + + if(direction == "left") { + str = next_href; + } else { + str = prev_href; + } + + var href = str.match(/https?:\/{2}[^\"]+/gi); + setTimeout(function() { - var content = $("#container").clone() - .find("#form_btn_layer").remove() - .end().find(".sit_pvi_btn").remove() - .end().html(); - var pos = $("#container").position(); - var width = $("#container").width(); - var height = $("#container").height(); - var pad_top = $("#container").css("padding-top"); - var next_href = ''; - var prev_href = ''; - var str, left_value; - var duration = 500; - - if(direction == "left") { - str = next_href; - left_value = "-="+width+"px"; - } else { - str = prev_href; - left_value = "+="+width+"px"; - } - - $("#container") - .css({ - width: width+"px", - height: height+"px" - }) - .before("
"+content+"
") - .find("*:visible").hide(); - - $("#container_clone") - .css({ - display: "block", - width: width+"px", - height: height+"px", - position: "absolute", - top: pos.top+"px", - left: pos.left+"px", - zIndex: "1000", - paddingTop: pad_top - }) - .animate( - { left: left_value }, duration, - function() { - $("#container_clone").remove(); - var href = str.match(/https?:\/{2}[^\"]+/gi); - document.location.href = href[0]; - } - ); - }, 100); + document.location.href = href[0]; + }, 500); } function load_message()