Authored by 毕凯

优惠券点击背景变色

... ... @@ -70,6 +70,16 @@ $('#coupon-list').on('touchend', '.employ-main', function() {
orderInfo('couponCode', $this.data('coupon-code'));
orderInfo('couponName', $this.data('coupon-name'));
}).on('touchstart', '.employ-main', function() {
var $this = $(this);
$this.siblings().removeClass('focus');
$this.addClass('focus');
}).on('touchend touchcancel', '.employ-main', function() {
var $this = $(this);
$this.siblings().removeClass('focus');
$this.removeClass('focus');
});
$('body').on('touchend', '.not-use', function() {
... ...
... ... @@ -40,6 +40,9 @@
background-size: 100% 100%;
color: #fff;
position: relative;
&.focus {
background-image: image-url('me/employ/employ-red.jpg');
}
span{
width: 34.482759%;
height: 100%;
... ...