Authored by xuqi

plus star detail -> hammer

... ... @@ -5,6 +5,7 @@
*/
var $ = require('jquery'),
Hammer = require('hammer'),
ellipsis = require('mlellipsis'),
lazyLoad = require('yoho.lazyload');
... ... @@ -20,6 +21,8 @@ var brandId = $('#brand-info').data('id');
var mIntro, aIntro;
var moreHammer, likeHammer;
ellipsis.init();
//Init LazyLoad
... ... @@ -37,8 +40,9 @@ setTimeout(function() {
info.initInfosEvt($infosContainer);
//文字介绍收起与展开
$('#more-intro').bind('tap', function() {
var $this = $(this);
moreHammer = new Hammer(document.getElementById('more-intro'));
moreHammer.on('tap', function(e) {
var $this = $(e.target).closest('#more-intro');
$this.toggleClass('spread');
... ... @@ -52,13 +56,18 @@ $('#more-intro').bind('tap', function() {
//隐藏
$intro.text(mIntro);
$imt.text('more');
$(window).scrollTop(0, 400); //滑动到顶部
}
e.preventDefault(); //防止收缩后误点到商品产生跳转
});
//品牌收藏
$('#brand-like').bind('tap', function(e) {
likeHammer = new Hammer(document.getElementById('brand-like'));
likeHammer.on('tap', function(e) {
var opt = 'ok',
$this = $(this);
$this = $(e.target);
e.preventDefault();
... ... @@ -78,6 +87,8 @@ $('#brand-like').bind('tap', function(e) {
$this.toggleClass('like');
} else if (data.code === 400) {
tip.show('未登录');
} else {
tip.show(data.message);
}
},
error: function() {
... ...
... ... @@ -160,7 +160,6 @@
&.spread .icon {
@include rotate(-180deg);
@include scale(0.83);
}
}
... ...