商品详情页面判断浏览器类别 给予不同的className @赵彪
Showing
2 changed files
with
8 additions
and
5 deletions
@@ -18,6 +18,8 @@ var introUrl = $('#introUrl').val(), | @@ -18,6 +18,8 @@ var introUrl = $('#introUrl').val(), | ||
18 | var sizeSwiper, | 18 | var sizeSwiper, |
19 | refSwiper; | 19 | refSwiper; |
20 | 20 | ||
21 | +var UA = navigator.userAgent.toLowerCase().toString(); | ||
22 | + | ||
21 | //判断是否要显示向左滑动提示 | 23 | //判断是否要显示向左滑动提示 |
22 | function hiddenTips($ele) { | 24 | function hiddenTips($ele) { |
23 | var offsetContainer, | 25 | var offsetContainer, |
@@ -69,7 +71,9 @@ function search() { | @@ -69,7 +71,9 @@ function search() { | ||
69 | 71 | ||
70 | hiddenTips($('#size-swiper-container')); | 72 | hiddenTips($('#size-swiper-container')); |
71 | hiddenTips($('#reference-swiper-container')); | 73 | hiddenTips($('#reference-swiper-container')); |
72 | - | 74 | + if (UA.indexOf('mqqbrowser') > 0) { |
75 | + $('.detail > div').removeClass('column').addClass('oldbox'); | ||
76 | + } | ||
73 | searching = false; | 77 | searching = false; |
74 | end = true; | 78 | end = true; |
75 | loading.hideLoadingMask(); | 79 | loading.hideLoadingMask(); |
@@ -16,7 +16,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'), | @@ -16,7 +16,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'), | ||
16 | goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl); | 16 | goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl); |
17 | 17 | ||
18 | var $cart = $('.cart-bar'); | 18 | var $cart = $('.cart-bar'); |
19 | -var UA = navigator.userAgent.toLowerCase().toString(); | 19 | + |
20 | 20 | ||
21 | require('./desc'); | 21 | require('./desc'); |
22 | require('./comments-consults'); | 22 | require('./comments-consults'); |
@@ -82,7 +82,6 @@ $.ajax({ | @@ -82,7 +82,6 @@ $.ajax({ | ||
82 | } | 82 | } |
83 | }); | 83 | }); |
84 | 84 | ||
85 | -if (UA.indexOf('mqqbrowser') > -1) { | ||
86 | - $('.detail > div').removeClass('column').addClass('oldbox'); | ||
87 | -} | 85 | + |
86 | + | ||
88 | require('./like'); | 87 | require('./like'); |
-
Please register or login to post a comment