Jquery回到顶部插件【query.scrollUp.js】使用
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="58IMG.COM" />
<title>jQuery返回顶部插件-jquery.scrollUp.min.js</title>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<!-- 回到顶部 jquery插件 -->
<script src="https://cdn.bootcss.com/scrollup/2.4.1/jquery.scrollUp.min.js"></script>
<style type="text/css">
.content { height: 1500px; }
#scrollUp { background-image: url("top.png"); bottom: 20px; right: 20px; width: 38px; height: 38px; }
</style>
</head>
<body>
<div class="content"></div>
<script type="text/javascript">
$(function () {
//scrollup
$.scrollUp({
scrollName: 'scrollUp', // Element ID
topDistance: '300', // Distance from top before showing element (px)
topSpeed: 300, // Speed back to top (ms)
animation: 'fade', // Fade, slide, none
animationInSpeed: 200, // Animation in speed (ms)
animationOutSpeed: 200, // Animation out speed (ms)
scrollText: '', // Text for element
activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
});
});
</script>
</body>
</html>
除以上代码还需引入一张点击的图标图片,
最新学习canvas,可以利用canvas绘制向上箭头的图标,代替 箭头图片:【推荐】
代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="58IMG.COM" />
<title>jQuery返回顶部插件-jquery.scrollUp.min.js</title>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<!-- 回到顶部 jquery插件 -->
<script src="https://cdn.bootcss.com/scrollup/2.4.1/jquery.scrollUp.min.js"></script>
<style type="text/css">
.content { height: 1500px; }
#scrollUp { background-color:#454545; border-radius:30px; bottom: 20px; right: 20px; width: 38px; height: 38px; }
</style>
</head>
<body>
<div class="content"> </div>
<script type="text/javascript">
$(function () { //scrollup background-image: url("top.png");
$.scrollUp({
scrollName: 'scrollUp', // Element ID
topDistance: '300', // Distance from top before showing element (px)
topSpeed: 300, // Speed back to top (ms)
animation: 'fade', // Fade, slide, none
animationInSpeed: 200, // Animation in speed (ms)
animationOutSpeed: 200, // Animation out speed (ms)
scrollText: '<canvas id="cvs" width="38px;" height="38px;" ></canvas>', // Text for element
activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF'
}); var canvas = document.getElementById('cvs');
cxt=canvas.getContext('2d');
cxt.beginPath();
cxt.lineCap = 'round';//圆线头
cxt.moveTo(13, 22);
cxt.lineTo(19,14);
cxt.lineTo(25,22);
cxt.strokeStyle = "#FBFBFB";
cxt.lineWidth = 3;
cxt.stroke();
});
</script>
</body>
</html>
Jquery回到顶部插件【query.scrollUp.js】使用的更多相关文章
- jQuery回到顶部插件jQuery GoUp
插件描写叙述 jQuery GoUp!是一个简单的jQuery插件,让你的网页用户直接回到顶部. 用法很easy 引用jquery库和jquery.goup.min.js到你的页面 <scrip ...
- jQuery回到顶部
jquery回到顶部 <!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset=& ...
- Jquery 回到顶部
转:http://www.cnblogs.com/DemoLee/archive/2012/04/20/2459082.html 用jQuery实现渐隐渐显的返回顶部效果(附多图) 先来看几个图片 ...
- html css jquery 回到顶部按钮
今天做了个回到顶部的功能,在这里记录一下,有需要可以拿去试试! CSS部分,很简单就一个class /*回到顶部*/ .back-top { position: fixed; right: 15px; ...
- jquery 回到 顶部
1. 页面内容较多, 从底部超链接 点击回到页面顶部 // 回到顶部 var $top = $('<a class="doc-gotop" href="javasc ...
- Jquery返回顶部插件
自己jquery开发的返回顶部,当时只为了自己用一下,为了方便,修改成了插件... 自己的博客现在用的也是这个插件..使用方便!! <!DOCTYPE html> <html> ...
- Jquery回到顶部功能
问题描述: 在网页中,我们经常会由于网页内容过长,而需要在浏览网页时有一个快速回到网页顶部的功能,在浏览网页内容离顶部有一段距离时,出现快速回到网页顶部的工具,从而能使我们的网页更人性化. 问题的产生 ...
- JQuery 回到顶部效果
图片,CSS/HTML/JS代码都在,可以直接用了. CSS代码 <style type="text/css"> #gs_feedback_gotop { _displ ...
- Jquery回到顶部效果
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> &l ...
随机推荐
- 007_项目制作拍摄视频篇之_《基于ARM与ZigBee的实验室签到系统》
研究的背景和意义: 随着社会生活节奏的加快,科技日新月异,信息更新迅速,人们之间的交流也变得越来越频繁,社会群体乃至政府之间的交流也朝着轻松.快速.容易管理和控制的方向发展,这种信息交流方式已经逐步得 ...
- 007_Python3 字符串
字符串是 Python 中最常用的数据类型.我们可以使用引号( ' 或 " )来创建字符串. 创建字符串很简单,只要为变量分配一个值即可. 例如: var1 = 'Hello World!' ...
- DOM Composition 事件
做实时的表单表单校验时,如果输入的是非拉丁语言,那你可能会遇到下面的问题: 如上图所示,文本框不允许输入 ' 之类的特殊字符,当用户在敲击拼音.还未最终输入时就已经触发了校验,提示输入不合法,有点尴尬 ...
- 【csp模拟赛九】--dfs
思路: 这道题可以宽搜,深搜,最短路 代码: #include<cstdio> #include<cstring> #include<iostream> #incl ...
- CF809E 【Surprise me!】
我们要求的柿子是张这样子的: \[\frac{1}{n * (n - 1)} * \sum_{i = 1}^n\sum_{j = 1}^{n}\phi(a_i*a_j)*dis(i, j)\] 其中\ ...
- python 使用PyKDL 四元数转欧拉角
安装: sudo apt-get install ros-indigo-kdl-parser-py 使用: import PyKDLimport math def quat_to_angle(quat ...
- Java基础系列 - JAVA集合ArrayList,Vector,HashMap,HashTable等使用
package com.test4; import java.util.*; /** * JAVA集合ArrayList,Vector,HashMap,HashTable等使用 */ public c ...
- Java+Bigdata学习路线
Java+Bigdata学习路线 2019-05-28 07:04:33 @Auther:MrZhangxd STAGE 第一阶段:JAVA基础 |-第一阶段:JAVA基础 | |-可掌握的核心能力 ...
- ZR#988
ZR#988 解法: 先算出横着能排多少座位, 以及需要排几列, 才能把 n 个座位全部排下来.要使得尽量多的位置在走廊边上, 于是在 n 列中插入走廊的策略是显然的, 我们只要以两列为单位, 在其中 ...
- mysql和mssql数据库快速创建表格 五
* into testAAA FROM tbl_User --sqlserver方法一复制表结构 select * into testAAA FROM tbl_User --sqlserver复制表结 ...