哈尔波儿
2018-08-10
君丿
2017-05-10
是的 可以学别的系统讲解jq的视频
qq_不再犯错_0
2017-01-06
if (windowHeight > sideHeight) {
$('#J_BdSide').css({
'position' : 'fixed',
right : '0px',
top : 0
});
小于的话就把top : -(sideHeight - $(window).height())改成top:0
dky
2016-12-07
没有支持的函数
慕粉3913390
2016-11-26
因为是直接在html结构最底下写的
剪不断理还乱
2016-09-27
qq_感观世界_03339825
2016-09-24
应该是screenHeight,老师写错了,后来改了
请叫我黑黑
2016-09-05
监听windows的加载事件,和监听用户windows的窗口大小的事件,让窗口大小随之变化。应该可以这么理解吧
spongebob12
2016-08-16
fixed固定定位,参考的是屏幕内的网页窗口本身。而视图本身是固定的,所以即使浏览器滚动条滚动了,位置也没发生变化
absolute绝对定位,是参考最接近的一个具有定位属性的父包含块,滚动条滚动了,其位置会发生变化. absolute和relative一般一起用。
飞天意大利面神兽
2016-08-05
你是否将样式写在了行间?
莲莲0
2016-07-29
DangCode
2016-05-08
jWindow.scroll(function(){
//滚动高度
var scrollHeight=jWindow.scrollTop();
//屏幕高度
var screenHeight=jWindow.height();
//右侧边栏高度
var fixedHeight=$('.fixed').height();
var left=$('.fixed').offset().left;
if(scrollHeight+screenHeight>fixedHeight){
$('.fixed').css({'position':'fixed','top':-(fixedHeight-screenHeight),'left':left});
}
else{
$('.fixed').css({'position':'static','left':0,'top':0});
}
});
'top':-(fixedHeight-screenHeight) //当滚动高度+屏幕高度>右侧边栏高度时,右侧边栏的为固定定位,定位top为剩下的高度。
好吧,你方法也可以!
一笔一书
2016-03-10
出现跳跃 domSider.style.cssText = 'position:fixed; right:0px; top:'+(-(sideHeight-screenHeight))+'px';改成domSider.style.cssText += 'position:fixed; right:0px; top:'+(-(sideHeight-screenHeight))+'px';因为cssText会把之前的样式清空,所以要+=
june18th
2015-08-16
梦身
2015-08-02
你想啊,最终top距离屏幕上边有固定的高度,所以需要加个负号。
粉干
2015-06-22
studyabc
2015-06-13
我现在也可以下载啊,是不是浏览器的问题?
慕媛
2015-05-18
错了,应该是笔记才对。
慕媛
2015-05-18
慕媛
2015-05-18
点滴希望
2014-10-26
陈小七
2014-10-22
蒋腾飞同学
2014-10-22
mushishi
2014-09-29
mushishi
2014-09-29
mushishi
2014-09-29
mushishi
2014-09-29
哑剧
2014-09-25
聼着
2014-09-24
Kodo
2014-09-06