最新回答 / 間歇性狂躁癥7
if (windowHeight > sideHeight) { ? $('#J_BdSide').css({ ? ? ?'position' : 'fixed', ? ? ?right : '0px', ? ? ?top : 0 ? });小于的話就把top : -(sideHeight - $(window).height())改成top:0
2017-01-06
最新回答 / weibo_哆啦A夢有大口袋_0
jWindow.scroll(function(){ //滾動高度 var scrollHeight=jWindow.scrollTop(); //屏幕高度 var screenHeight=jWindow.height(); //右側邊欄高度 var fixedHeight=$('.fixed').height(); var left=$('.fixed').offset().left; if(scrollHeight+screenHeight>fixedH...
2016-05-08
最新回答 / core0
出現跳躍 domSider.style.cssText = 'position:fixed; right:0px;
top:'+(-(sideHeight-screenHeight))+'px';改成domSider.style.cssText +=
'position:fixed; right:0px;
top:'+(-(sideHeight-screenHeight))+'px';因為cssText會把之前的樣式清空,所以要+=
2016-03-10