我写完的js动画没有反应,没找到问题在哪,老师,求助一下,下面是我的代码
个人作品网
TOP
// JavaScript Document
/*侧边栏隐藏*/
$(".dianji").click(function () {
"use strict";
$(".cehua_mask").fadeIn();
$(".silder").css("right",0);
});
$(".cehua_mask").click(function () {
"use strict";
$(".cehua_mask").fadeOut();
$(".silder").css("right",-300);
});
/*到这里是侧边栏隐藏*/
/*下面是置顶按钮*/
$(window).scroll(function(){
"use strict";
if($(window).scrollTop()>100){
$(".top").css("display","block");
}
else{
$(".top").css("display","none");
}
});
$(".top").click(function(){
"use strict";
$("html").animate({
scrollTop:0
},300);
});
/*置顶按钮到这里*/
/*侧滑栏*/
.cehua_mask{
display: none;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,0.3);
}
.silder{
background: #333;
position: fixed;
top: 0;
right: -300px;
bottom: 0;
width: 300px;
transition: 0.5s;
}
.silder ul li{
margin-top: 30px;
padding: 20px;
}
.silder ul li:hover{
background: #7F7F7F;
}
.silder ul li a{
color: #fff;
}
/*置顶按钮*/
.top{
display: none;
width: 50px;
height: 30px;
position: fixed;
right: 30px;
bottom: 120px;
}
.top p,img{
width: 100%;
text-align: center;
} |
免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。
版权声明:作者保留权利,不代表天盟立场。
|
|
|
|