Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
viewport.on('scroll', function () {
var scrollTop = viewport.getScrollTop();
if (scrollTop < sHeight) {
$('.item-hd-so-box').css('margin-top', -scrollTop);
}
else if (scrollTop === 0) {
$('.item-hd-so-box').css('margin-top', 0);
}
else {
$('.item-hd-so-box').css('margin-top', -sHeight);
}
});
// 展开全文
viewport.on('scroll', function () {
// 滚动条滚动的距离
var scrollTop = viewport.getScrollTop();
// 内容高度
var domHeight = viewport.getScrollHeight();
// 视口高度
var viewHei = viewport.getHeight();
if ($(ele.scrollClass).length > 0) {
var eleTop = $(ele.scrollClass).offset().top;
if (location.host === 'm.jia.com' || util.platform.isAndroid()) {
if (scrollTop > 10 && eleTop > scrollTop + viewHei / 2) {
$(ele.class).parent().addClass('hide');
}
else {
$(ele.class).parent().removeClass('hide');
}
if (eleTop <= scrollTop + viewHei / 2) {
$(ele.class).parent().addClass('shake');
$el.find('.fixed_cirle1').click(function () {
console.log(viewport.getScrollTop());
$el.find('.fixedshow').addClass('fixedshowbug');
$el.find('.dialog_relaxed').show();
$el.find('.relaxed_content').css('top', viewport.getScrollTop() + 300 + 'px');
$el.find('.dialog_relaxed').css('height', viewport.getScrollTop() + 1000 + 'px');
stop();
$el.find('.relaxed_content').bind('touchmove', function (e) {
e.preventDefault();
});
$el.find('.dialog_relaxed').bind('touchmove', function (e) {
e.preventDefault();
});
});
$el.find('.delete').click(function () {
viewport.on('scroll', function (e) {
if (viewport.getScrollTop() + viewport.getHeight() >= viewport.getScrollHeight() - 20) {
if (ajaxs.nowPage === ajaxs.totalPage) {
return;
}
else {
dropload(element, params);
}
}
});
}
viewport.on('scroll', function () {
if (viewport.getHeight() + viewport.getScrollTop() >= viewport.getScrollHeight() - dis) {
that.control();
}
});
}
viewport.on('scroll', function (e) {
if (viewport.getScrollTop() + viewport.getHeight() >= viewport.getScrollHeight()) {
if (ajaxs.nowPage === params.count || ajaxs.nowPage >= params.count) {
$(element).find('.dropload-down').html(endhtml);
return;
}
else {
dropload(element, params);
}
}
});
}
viewport.on('scroll', function () {
if (viewport.getHeight() + viewport.getScrollTop() >= viewport.getScrollHeight() - dis) {
that.$parentBox.is(':visible') && that.control();
}
});
}
viewport.on('scroll', function () {
var scrollTop = viewport.getScrollTop();
if (scrollTop < sHeight) {
$('.chat-top').css('margin-top', -scrollTop);
} else if (scrollTop === 0) {
$('.chat-top').css('margin-top', 0);
} else {
$('.chat-top').css('margin-top', -sHeight);
}
});
viewport.on('scroll', function () {
var scrollTop = viewport.getScrollTop();
if (scrollTop < sHeight) {
$('.chat-top').css('margin-top', -scrollTop);
} else if (scrollTop === 0) {
$('.chat-top').css('margin-top', 0);
} else {
$('.chat-top').css('margin-top', -sHeight);
}
});
viewport.on('scroll', function () {
var st = viewport.getScrollTop();
tabPanelIds.forEach(function (item, index) {
var tabPanelElement = document.querySelector(item);
var top = tabPanelElement.offsetTop - elementHeight;
var bottom = tabPanelElement.offsetHeight + top;
if (st > top && st < bottom) {
var anchorElement = tabAnchorItems[index];
var activeAnchor = anchorElement.parentNode.querySelector('.' + activeClassName);
activeAnchor && activeAnchor.classList.remove(activeClassName);
anchorElement.classList.add(activeClassName);
}
});
});