installment.page.js
959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
var $ = require('yoho-jquery'),
ellipsis = require('yoho-mlellipsis'),
lazyLoad = require('yoho-jquery-lazyload');
var $installmentOnly = $('.installment-only');
var $this, $title;
lazyLoad($('img.lazy'));
ellipsis.init();
$('.good-detail-text .name').each(function() {
$this = $(this);
$title = $this.find('a');
$title[0].mlellipsis(2);
});
if ($installmentOnly.length > 0) {
$('.installment-page').css({
background: '#efefef'
});
}
if ($('.installment-bg').length > 0) {
$('body').css({
background: '#efefef'
});
}
$('.detail-tab span').on('click', function() {
$(this).addClass('on').siblings().removeClass('on');
$('.installment-cont').hide().eq($(this).index()).show();
if ($(this).index() === 1) {
$('.good-detail-text .name').each(function() {
$this = $(this);
$title = $this.find('a');
$title[0].mlellipsis(2);
});
}
});