ShopWT官网-php多用户商城系统-在路上
标题:
楼层导航的问题 33好的
[打印本页]
作者:
lhlt138
时间:
2016-9-13 09:38
标题:
楼层导航的问题 33好的
(, 下载次数: 4)
上传
点击文件名下载附件
/*监听滚动条和左侧菜单点击事件 start b y 33 hao.com*/
var _arr = [];
window.onscroll = function(){
if(850 < $(document).scrollTop()){ //原值800
$('.nav_Sidebar').fadeIn('slow');
}
// if(2500 > $(document).scrollTop()){ //原值800
// $('.nav_Sidebar').fadeOut('slow');
else{
$('.nav_Sidebar').fadeOut('slow');
}
$('.home-standard-layout').each(function(index){
var that = $(this);
that.index = index;
if($(document).scrollTop() + $(window).height()/2 > that.offset().top){
_arr.push(index);
}
});
if(_arr.length){
$('.nav_Sidebar a').eq(_arr[_arr.length-1]).css({'backgroundImage':'url('+SHOP_SITE_URL+'/templates/default/images/home-nav-icon-hover.png)'}).addClass('current').siblings().css({'backgroundImage':'url('+SHOP_SITE_URL+'/templates/default/images/home-nav-icon.png)'}).removeClass('current');
_arr = [];
}
}
$('.nav_Sidebar a').each(function(index){
$(this).click(function(){
$('html,body').animate({scrollTop: $('.home-standard-layout').eq(index).offset().top - 20 + 'px'}, 1000);
}).mouseover(function(){ //原值.top-20 500
if($(this).hasClass('current')){
return;
}else{
$(this).css({'backgroundImage':'url('+SHOP_SITE_URL+'/templates/default/images/home-nav-icon-hover2.png)'});
}
}).mouseout(function(){
if($(this).hasClass('current')){
return;
}else{
$(this).css({'backgroundImage':'url('+SHOP_SITE_URL+'/templates/default/images/home-nav-icon.png)'});
}
});
});
window.onload = window.onresize = function(){
if($(window).width() < 1100 || 800 > $(document).scrollTop()){ //原值1300 800
$('.nav_Sidebar').fadeOut('slow');
}else{
$('.nav_Sidebar').fadeIn('slow');
}
}
/*end*/
作者:
lhlt138
时间:
2016-9-13 09:50
(, 下载次数: 6)
上传
点击文件名下载附件 导航到上部还有内容,怎么隐藏
作者:
shopwt
时间:
2016-9-13 14:52
点击返回顶部的代码换为其它的,不要原来的哪种。
作者:
lhlt138
时间:
2016-9-13 15:50
shopwt 发表于 2016-9-13 14:52
点击返回顶部的代码换为其它的,不要原来的哪种。
不是很明白,回到顶部的是在右侧
作者:
lhlt138
时间:
2016-9-13 15:54
shopwt 发表于 2016-9-13 14:52
点击返回顶部的代码换为其它的,不要原来的哪种。
js冲突吗??
欢迎光临 ShopWT官网-php多用户商城系统-在路上 (https://bbs.shopwt.com/)
Powered by Discuz! X3.4