bottombar-click-handle
Showing
1 changed file
with
6 additions
and
7 deletions
@@ -97,7 +97,7 @@ function diXuanFuInit() { | @@ -97,7 +97,7 @@ function diXuanFuInit() { | ||
97 | let $bottomFixClickArea = $('#bottomFixClickArea'); | 97 | let $bottomFixClickArea = $('#bottomFixClickArea'); |
98 | let $bottomPerShow = $('.per-show'); | 98 | let $bottomPerShow = $('.per-show'); |
99 | let href = '//activity.yoho.cn/featurebottombar/'; | 99 | let href = '//activity.yoho.cn/featurebottombar/'; |
100 | - let currentClickElem; | 100 | + let lastClickElem; |
101 | let currentElemclickTimes = 0; | 101 | let currentElemclickTimes = 0; |
102 | 102 | ||
103 | if (location.hostname === 'm.yohobuy.com') { | 103 | if (location.hostname === 'm.yohobuy.com') { |
@@ -114,17 +114,16 @@ function diXuanFuInit() { | @@ -114,17 +114,16 @@ function diXuanFuInit() { | ||
114 | 114 | ||
115 | $('#bottomClick' + pageId).on('click', () => { | 115 | $('#bottomClick' + pageId).on('click', () => { |
116 | $bottomPerShow.addClass('hide'); | 116 | $bottomPerShow.addClass('hide'); |
117 | - if ($bottomShow.hasClass('hide')) { | ||
118 | - if (currentClickElem === pageId && currentElemclickTimes > 1) { | 117 | + if (!lastClickElem) { |
118 | + currentElemclickTimes++; | ||
119 | + } | ||
120 | + if (lastClickElem === pageId && currentElemclickTimes > 1) { | ||
119 | currentElemclickTimes = 0; | 121 | currentElemclickTimes = 0; |
120 | } else { | 122 | } else { |
121 | $bottomShow.removeClass('hide'); | 123 | $bottomShow.removeClass('hide'); |
122 | } | 124 | } |
123 | - } else { | ||
124 | - $bottomShow.addClass('hide'); | ||
125 | - } | ||
126 | 125 | ||
127 | - currentClickElem = pageId; | 126 | + lastClickElem = pageId; |
128 | currentElemclickTimes++; | 127 | currentElemclickTimes++; |
129 | }); | 128 | }); |
130 | }); | 129 | }); |
-
Please register or login to post a comment