window.onscroll = function(){
$("pop").css("top","200px");
};
这样写,怎么滚动时候,没有反应???
<html>
<style>
.pop{
posistion:fixed;
top:10px;
wodth:100%;
height:25px;
background:#fff;
}
</style>
<body>
<div class="pop" id="pop">
<p style="text-align:center;">这是标题</p>
</div>
</body>
</html>
你jquery的都没有导入怎么会有翻译。。js代码也没放入script中,css属性也拼写错误,position,width
<html>
<style>
.pop {
position: fixed;
top: 10px;
width: 100%;
height: 25px;
background: #fff;
}
</style><script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"></script><body>
<div class="pop" id="pop">
<p style="text-align:center;">这是标题</p>
</div>
<script>
window.onscroll = function () {
$(".pop").css("top", "200px");
};
</script>
<div style="height:1000px"></div>
</body>
</html>