jquery实现简单的回到顶部
来源:互联网 发布:mysql删除表数据 编辑:程序博客网 时间:2024/05/16 13:58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
<style>
.box1{
width:35px;
height:35px;
background-color: #00b3ee;
text-align: center;
line-height: 35px;
font-size: 36px;
font-weight: bold;
text-decoration: none;
display: block;
position: fixed;
bottom:30px;
right:30px;
display: none;
}
.box1:hover{
background-color: #00B83F;
}
</style>
</head>
<body>
<div style="background:#ff9900;height:100px;"></div>
<div style="background:#ccc;height:1200px;"></div>
<a href="javascript:(0);" class="box1">↑</a>
<script>
$(function(){
$(window).scroll(function(){
var t = $(this).scrollTop();
if(t>100){
$(".box1").fadeIn();
}else{
$(".box1").fadeOut();
}
});
$(".box1").on("click",function(){
$("body,html").animate({scrollTop:0},300);
});
})
</script>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
<style>
.box1{
width:35px;
height:35px;
background-color: #00b3ee;
text-align: center;
line-height: 35px;
font-size: 36px;
font-weight: bold;
text-decoration: none;
display: block;
position: fixed;
bottom:30px;
right:30px;
display: none;
}
.box1:hover{
background-color: #00B83F;
}
</style>
</head>
<body>
<div style="background:#ff9900;height:100px;"></div>
<div style="background:#ccc;height:1200px;"></div>
<a href="javascript:(0);" class="box1">↑</a>
<script>
$(function(){
$(window).scroll(function(){
var t = $(this).scrollTop();
if(t>100){
$(".box1").fadeIn();
}else{
$(".box1").fadeOut();
}
});
$(".box1").on("click",function(){
$("body,html").animate({scrollTop:0},300);
});
})
</script>
</body>
</html>
0 0
- jquery实现简单的回到顶部
- Jquery实现简单回到顶部效果
- JQuery实现回到顶部
- jquery 实现回到顶部
- Jquery实现回到顶部
- JQuery实现页面回到顶部
- 用jQuery实现回到顶部
- 一个基于jquery回到顶部的简单代码
- jquery 实现极客公园的 回到顶部 效果
- 利用JQuery实现从底部回到顶部的功能
- 利用JQuery实现从底部回到顶部的功能
- 回到顶部的实现方式
- js 回到顶部的实现
- jquery实现点击回到页面顶部
- jQuery 实现小功能之回到顶部
- JavaScript和jQuery实现回到顶部效果
- JQuery之回到顶部的特效
- 【jQuery插件】回到顶部
- id_rsa are too open 的处理
- (转)ios push message -- Notification
- 用python简单处理图片(4):图像中的像素访问
- [Web前端技术教学]布局基础练习-1
- 每日积累(20161212-day-16)(PHILIPS 272P 显示器webcam ,ubuntu使用)
- jquery实现简单的回到顶部
- Android UI控件-Spinner(下拉列表)
- android百度地图使用(二)
- Maven环境搭建和介绍
- Unity3D ScriptableObject 一些坑
- POJ No.2758-4 Values Whose Sum is 0(折半枚举)
- synchronous redis transaction
- vim配置
- 把数组存入到cookie中