欢迎您  本站地址:   jQuery页面滚动左侧悬浮固定导航菜单代码-小库平台

小库平台

 找回密码
 立即注册
jQuery页面滚动左侧悬浮固定导航菜单代码-小库平台

小库平台

 找回密码
 立即注册
上一主题 下一主题

jQuery页面滚动左侧悬浮固定导航菜单代码

跳转到指定楼层
楼主
|只看大图 回帖奖励 |倒序浏览 |阅读模式

这是一款页面滚动下拉的时候左侧悬浮固定导航菜单代码,jQuery页面滚动固定层菜单网页特效下载。

js代码
<scripttype="text/javascript">
$(function(){
//设置标杆
var_line=parseInt($(window).height()/3);
$(window).scroll(function(){
//滚动730px,左侧导航固定定位
if($(window).scrollTop()>730){
$('.fl_l').css({'position':'fixed','top':10})
}else{
$('.fl_l').css({'position':'','top':''})
};
$('.fl_lli').eq(0).addClass('active');
//滚动到标杆位置,左侧导航加active
$('.fl_rli').each(function(){
var_target=parseInt($(this).offset().top-$(window).scrollTop()-_line);
var_i=$(this).index();
if(_target<=0){
$('.fl_lli').removeClass('active');
$('.fl_lli').eq(_i).addClass('active');
}
//如果到达页面底部,给左侧导航最后一个加active
elseif($(document).height()==$(window).scrollTop()+$(window).height()){
$('.fl_lli').removeClass('active');
$('.fl_lli').eq($('.fl_rli').length-1).addClass('active');
}
});
});
$('.fl_lli').click(function(){
$(this).addClass('active').siblings().removeClass('active');
var_i=$(this).index();
$('body,html').animate({scrollTop:$('.fl_rli').eq(_i).offset().top-_line},500);
});
});
</script>



下载
回复

使用道具 举报

小黑屋|小库平台

GMT+8, 2024-9-20 07:56 , Processed in 3.930884 second(s), 18 queries , Xcache On.

Powered by Discuz! 3.4

小库提示

扫描下方二维码,访问手机版。