用jQuery实现回到顶部
来源:互联网 发布:英国大学精算 知乎 编辑:程序博客网 时间:2024/06/04 19:31
jsp代码
<div class="go-top" title="返回顶部"><img src="img/go_top.png"/></div>
js代码
$(function(){// 回到顶部$(window).scroll(function() {if ($(window).scrollTop() > 0)$(".go-top").show();else$(".go-top").hide();});$(".go-top").click(function() {$("html, body").animate({scrollTop : 0}, 1000);});})
css代码
.go-top{display: none;position: fixed;top:80%;left: 90%;width: 60px;height: 60px;cursor: pointer;background: white;}.go-top img{width: 60px;height: 60px;}.go-top:hover{background-color: gray;opacity: 1;filter: alpha(opacity=100);}
效果
阅读全文
0 0
- 用jQuery实现回到顶部
- JQuery实现回到顶部
- jquery 实现回到顶部
- Jquery实现回到顶部
- JQuery实现页面回到顶部
- jquery实现点击回到页面顶部
- Jquery实现简单回到顶部效果
- jQuery 实现小功能之回到顶部
- JavaScript和jQuery实现回到顶部效果
- jquery实现简单的回到顶部
- 【jQuery插件】回到顶部
- jquery 回到顶部
- jquery 回到顶部
- jquery插件,回到顶部
- jQuery动态回到顶部
- Jquery “回到顶部”
- jquery回到动态顶部
- jquery回到顶部
- JSP学习笔记—JSP概述和背后原理
- 【LibUIDK界面库系列文章】对话框坐标单位
- Qt中配置OpenCV库的另类方法
- cannot convert t (type interface {}) to type string: need type assertion
- Java编程思想---第四章笔记
- 用jQuery实现回到顶部
- 启动hadoop 2.6遇到的datanode启动不了
- LeetCode-87-Scramble String DFS+剪枝
- 剑指Offer------反转链表
- 深入浅出MySQL笔记(二)
- 两种开源聊天机器人的性能测试(一)——ChatterBot
- jq代码学习9--合成事件 fl ch4 105
- java小程序——提取地址中的文件名
- 嵌入式多路温湿度监控系统(十一boa网页界面)