哪位能帮我详细解释一下下面的JS代码? 80
<script>vardefaultSwiper;//默认的滚动控件名varholdPosition=0;varmaxposition=0;varpage=1;varpa...
<script>
var defaultSwiper; //默认的滚动控件名
var holdPosition = 0;
var maxposition = 0;
var page =1;
var pageend = false;
var dev_wrapper_height = 0;
var loadflag = true;
var scrollflag = true;
$(function(){
var mainheight = $(window).height();//窗口高度
var mainwidth = $(window).width();//窗口宽度
var wrapperHeight = mainheight-50;
// Tmsg(wrapperHeight);
var wxbglogo_height = $('#wxbglogo').height();
// $('#dev_wrapper').css('marginTop','-'+wxbglogo_height+'px');
$('#dev_wrapper').css('maxHeight',wrapperHeight+'px');
$("#dev_wrapper").scroll(function() {
var dev_scrollTop = $('#dev_wrapper').scrollTop() ;
// Tmsg(dev_scrollTop);
if( dev_scrollTop >= 100 ){
$("#wxbglogo").hide();
$('.home_change_head_top').addClass('navaA');
}else{
$("#wxbglogo").show();
$('.home_change_head_top').removeClass('navaA');
}
var xiangcha = dev_scrollTop%wrapperHeight;
if( xiangcha <= 60 ){
}
$("img").lazyload({
threshold :20
});
加载翻页用
var dev_wrapper_height = $('#dev_wrapper').height();
//console.log((dev_wrapper_height-mainheight-100)+"------"+dev_scrollTop);
if( (dev_wrapper_height-mainheight-100) <= dev_scrollTop && loadflag == true ){
loadflag = false;
Tmsg("到达第"+page+"页");
loadmore();
}
var xc = dev_wrapper_height-dev_scrollTop;
});
setTimeout("newlazyload()",6000);
});
</script> 展开
var defaultSwiper; //默认的滚动控件名
var holdPosition = 0;
var maxposition = 0;
var page =1;
var pageend = false;
var dev_wrapper_height = 0;
var loadflag = true;
var scrollflag = true;
$(function(){
var mainheight = $(window).height();//窗口高度
var mainwidth = $(window).width();//窗口宽度
var wrapperHeight = mainheight-50;
// Tmsg(wrapperHeight);
var wxbglogo_height = $('#wxbglogo').height();
// $('#dev_wrapper').css('marginTop','-'+wxbglogo_height+'px');
$('#dev_wrapper').css('maxHeight',wrapperHeight+'px');
$("#dev_wrapper").scroll(function() {
var dev_scrollTop = $('#dev_wrapper').scrollTop() ;
// Tmsg(dev_scrollTop);
if( dev_scrollTop >= 100 ){
$("#wxbglogo").hide();
$('.home_change_head_top').addClass('navaA');
}else{
$("#wxbglogo").show();
$('.home_change_head_top').removeClass('navaA');
}
var xiangcha = dev_scrollTop%wrapperHeight;
if( xiangcha <= 60 ){
}
$("img").lazyload({
threshold :20
});
加载翻页用
var dev_wrapper_height = $('#dev_wrapper').height();
//console.log((dev_wrapper_height-mainheight-100)+"------"+dev_scrollTop);
if( (dev_wrapper_height-mainheight-100) <= dev_scrollTop && loadflag == true ){
loadflag = false;
Tmsg("到达第"+page+"页");
loadmore();
}
var xc = dev_wrapper_height-dev_scrollTop;
});
setTimeout("newlazyload()",6000);
});
</script> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询