<!DOCTYPE?html>
<html>
<head>
<meta?charset="UTF-8">
<title>Document</title>
<style>
#fixBox{
???width:?50px;
???height:?200px;
???background-color:?red;
???position:?fixed;
???top:?300px;
???right:?0;
???display:?none;
}
</style>
<script?src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>
<script>
$(function?()?{
???$(window).scroll(function?()?{
???????if(?$(this).scrollTop()?>?200?){
???????????$("#fixBox").show().animate({"top":"100px"},?1000);
???????}else{
???????????//小于200的時(shí)候top回到原來的地方?
???????????//$("#fixBox").hide().css("top","300px");
???????????$("#fixBox").stop(true,true).hide().css("top","300px");
???????}
???})
});
</script>
</head>
<body>
<div?id="fixBox">
????</div>
????<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</body>
</html>不加stop(true,true)?小于200的時(shí)候top還是100px為什么?
為什么不加stop(true,true)css設(shè)置的值回不去
啊啊啊啊123
2017-03-12 10:42:53