pay.page.js
1.14 KB
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
44
45
46
47
48
49
50
51
52
53
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
var prompt = $('.fraud-prompt'),
tipContent = $('.tip-content'),
tip = $('.tip'),
fraudTip = $('.fraud-tip');
var tipConWidth = tipContent.width(),
tipWidth = tip.width(),
promptWidth = prompt.width();
var scrollVal,
onePageW,
diff;
require('../common');
lazyLoad($('img.lazy'));
function getGender() {
return window.cookie('_Channel') || 'boys';
}
require('../channel/maybe-like')(getGender());
if ($('#goods-list').length === 0) {
$('.maybe-like').hide();
}
if (tipConWidth > promptWidth - tipWidth) {
var speed = 30;
tipContent.width(tipConWidth + (promptWidth / 2));
fraudTip.append('<div class="tip-content">' + tipContent.html() + '</div>').css({
width: 2 * tipContent.width()
});
function Marquee() {
prompt.scrollLeft(prompt.scrollLeft() + 1);
scrollVal = prompt.scrollLeft();
onePageW = tipContent.eq(0).width();
diff = scrollVal - onePageW;
if (diff > 0) {
prompt.scrollLeft(Math.abs(diff));
}
}
setInterval(Marquee, speed);
}