|
|
var $ = require('yoho-jquery'),
|
|
|
lazyLoad = require('yoho-jquery-lazyload');
|
|
|
|
|
|
var prompt = $('.fraud-prompt');
|
|
|
var fraudTip, scrollVal, onePageH, diff, MyMar;
|
|
|
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');
|
|
|
|
...
|
...
|
@@ -18,24 +28,26 @@ if ($('#goods-list').length === 0) { |
|
|
$('.maybe-like').hide();
|
|
|
}
|
|
|
|
|
|
if ($('.fraud-tip').height() > $('.fraud-prompt').height()) {
|
|
|
var speed = 40;
|
|
|
if (tipConWidth > promptWidth - tipWidth) {
|
|
|
var speed = 30;
|
|
|
|
|
|
$('.fraud-prompt').append('<div class="fraud-tip">' + $('.fraud-tip').html() + '</div>');
|
|
|
tipContent.width(tipConWidth + (promptWidth / 2));
|
|
|
|
|
|
fraudTip = $('.fraud-tip').eq(1);
|
|
|
fraudTip.append('<div class="tip-content">' + tipContent.html() + '</div>').css({
|
|
|
width: 2 * tipContent.width()
|
|
|
});
|
|
|
|
|
|
function Marquee() {
|
|
|
prompt.scrollTop(prompt.scrollTop() + 1);
|
|
|
prompt.scrollLeft(prompt.scrollLeft() + 1);
|
|
|
|
|
|
scrollVal = prompt.scrollTop();
|
|
|
onePageH = fraudTip[0].offsetTop;
|
|
|
diff = onePageH - scrollVal;
|
|
|
scrollVal = prompt.scrollLeft();
|
|
|
onePageW = tipContent.eq(0).width();
|
|
|
diff = scrollVal - onePageW;
|
|
|
|
|
|
if (diff <= 0) {
|
|
|
prompt.scrollTop(Math.abs(diff));
|
|
|
if (diff > 0) {
|
|
|
prompt.scrollLeft(Math.abs(diff));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
MyMar = setInterval(Marquee, speed);
|
|
|
} |
|
|
\ No newline at end of file |
|
|
setInterval(Marquee, speed);
|
|
|
} |
...
|
...
|
|