惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Palo Alto Networks Blog
P
Proofpoint News Feed
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Recorded Future
Recorded Future
M
MIT News - Artificial intelligence
罗磊的独立博客
J
Java Code Geeks
月光博客
月光博客
F
Full Disclosure
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
U
Unit 42
WordPress大学
WordPress大学
A
About on SuperTechFans
C
Cyber Attacks, Cyber Crime and Cyber Security
SecWiki News
SecWiki News
Security Latest
Security Latest
C
Check Point Blog
C
CERT Recently Published Vulnerability Notes
小众软件
小众软件
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog RSS Feed
V
Visual Studio Blog
博客园_首页
NISL@THU
NISL@THU
I
Intezer
Spread Privacy
Spread Privacy
AWS News Blog
AWS News Blog
The Register - Security
The Register - Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Latest news
Latest news
Project Zero
Project Zero
博客园 - 叶小钗
C
Cybersecurity and Infrastructure Security Agency CISA
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy International News Feed
博客园 - 【当耐特】
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threat Research - Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
T
Tor Project blog
V
Vulnerabilities – Threatpost
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网

博客园 - 落叶潇潇雨

Can't get WebApplicationContext object from ContextRegistry.GetContext(): Resource handler for the 'web' protocol is not defined xml序列化与反序列化 Asp.net 导出Excel How to debug Typescript in browser log4net使用的关键点 DataContractSerializer序列化与反序列化遇到的奇怪问题 图文安装Windows Template Library - WTL Version 9.0 WCF的传输安全(读书笔记) Asp.net mvc 各个组件的分离 同程旅游网开放平台SDK开发完成 SQL多行变一列 Timer的schedule和scheduleAtFixedRate方法的区别解析 android 主线程和子线程之间的消息传递 activity生命周期 瀑布流插件 CSS自适应宽度圆角按钮 ajaxFileUpload上传文件和表单数据 Ajax上传表单数据和文件 使用Rhino Mocks
csdn回到顶端
落叶潇潇雨 · 2013-08-07 · via 博客园 - 落叶潇潇雨

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>test</title>
<script src="jquery-1.4.2.min.js" type="text/javascript"></script>
</head>
<style type="text/css">    
img 
{
border
: none;
}
input, checkbox, select, img 
{
vertical-align
: middle;
}
Inherited from div.wrap
.wrap 
{
text-align
: left;
}
body, div, label, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, p, blockquote, th, td 
{
list-style
: none;
}
body 
{
color
: #333;
font
: normal 12px/24px Helvetica, Tahoma, Arial, sans-serif;
text-align
: center;
}
body, div, label, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, p, blockquote, th, td 
{
list-style
: none;
}
p
{
    height
:100px;
}

.top_arrow 

{
    border
: 0 none;
    bottom
: 150px;
    cursor
: pointer;
    display
: block;
    height
: auto;
    margin
: 0;
    opacity
: 0.5;
    padding
: 0;
    position
: fixed;
    right
: 40px;
    width
: 35px;
    z-index
: 2147483647;
}
</style>

<body>
<p>段落1</p>
<p>段落2</p>
<p>段落3</p>
<p>段落4</p>
<p>段落5</p>
<p>段落6</p>
<p>段落7</p>
<p>段落8</p>
<p>段落9</p>
<p>段落10</p>
<p>段落11</p>
<p>段落12</p>
<p>段落13</p>
<p>段落14</p>
<p>段落15</p>
<img alt="Top_arrow" id="top_arrow" class="top_arrow" src="top_arrow.png" style="display: block; cursor: pointer;">
<script type="text/javascript" src="top_arrow.js?20121128"></script>
</body>
</html>

js文件代码:

$(document).ready(function(){

//首先将#top_arrow隐藏

    $("#top_arrow").hide();

//当滚动条的位置处于距顶部100像素以下时,跳转链接出现,否则消失

    $(function () {
        $(window).scroll(function(){
            if ($(window).scrollTop()>100){
                $("#top_arrow").fadeIn(400);
            }
            else
            {
                $("#top_arrow").fadeOut(400);
            }
        });

//当点击跳转链接后,回到页面顶部位置

        $("#top_arrow").click(function(){
            $('body,html').animate({scrollTop:0},400);
            return false;
        });
    });

}); 

完整代码和例子下载:https://files.cnblogs.com/jackhuclan/backtop.rar