/*監(jiān)聽滾動條和左側(cè)菜單點擊事件?*/
????????????var?_arr?=?[];
????????????window.onscroll?=?function(){
????????????????if(800?<?$(document).scrollTop()){
????????????????????$('.nav_Sidebar').fadeIn('slow');
????????????????}else{
????????????????????$('.nav_Sidebar').fadeOut('slow');
????????????????}
????????????????scrollBottomTest();
????????????????$('.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'},?500);
????????????????}).mouseover(function(){
????????????????????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()?<?1300?||?800?>?$(document).scrollTop()){
????????????????????$('.nav_Sidebar').fadeOut('slow');
????????????????}else{
????????????????????$('.nav_Sidebar').fadeIn('slow');
????????????????}
????????????}
/*end*/
//$("#js_banner_top").show();
$("#js_banner_top").slideDown(800);
});<div?class="nav_Sidebar"?style="display:?block;">
????<a?class="nav_Sidebar_1"?href="javascript:;"?style="background-image:?url(????mplates/default/images/home-nav-icon.png);"></a>
????<a?class="nav_Sidebar_2"?href="javascript:;"></a>
????<a?class="nav_Sidebar_3"?href="javascript:;"></a>
????<a?class="nav_Sidebar_4"?href="javascript:;"></a>
????<a?class="nav_Sidebar_5"?href="javascript:;"></a>
????<a?class="nav_Sidebar_6"?href="javascript:;"></a>?
????<a?class="nav_Sidebar_7"?href="javascript:;"></a>
????<a?class="nav_Sidebar_8"?href="javascript:;"></a>
</div>.nav_Sidebar?{
????width:?50px;
????height:?396px;
????position:?fixed;
????bottom:?100px;
????left:?50%;
????margin-left:?-660px;
????display:?none;
}頂部的實現(xiàn)了,到底部時,隱藏,我寫了幾次,實現(xiàn)不了,求大神幫助。 ?測試網(wǎng)站?shopnc.96567.com?
關(guān)于右側(cè)樓層導(dǎo)航,到底部距離400px時,自動隱藏。怎么繼續(xù)寫這個JavaScript呢?
班大人
2015-10-20 15:30:40