1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 制作一个html页面返回顶部的悬浮按钮

制作一个html页面返回顶部的悬浮按钮

时间:2022-08-19 01:16:54

相关推荐

制作一个html页面返回顶部的悬浮按钮

web前端|html教程

html,顶部,悬浮按钮

web前端-html教程

有游戏源码怎么安装包,vscode怎么找出requests,ubuntu samba,json tomcat,sqlite3 svn,网页设计中的常见错误,数据库执行语句,阿里云服务器 ip访问,easyui插件下载,前端哪个框架中有render,爬虫头部,xdebug php,seo前途,介绍springboot,织梦当前内容页url标签,php网站发送邮件,网页模板 百度云,免费中文模板,网站后台卸载cmsdede,易企秀微官网登陆页面,房地产销售管理系统源码,vb程序显示源数据lzw

具体代码如下所示:

信用卡活动网站源码,ubuntu声音切换不了,tomcat的下载文件,爬虫做程序,php商城订单系统,seo武汉培训lzw

(学习视频分享:html视频教学)

记录注册用户系统推广源码,ubuntu启动引导区,反爬虫参数配置,array在php,湛江新站seolzw

CSS样式代码:

.back-to { bottom: 55px; overflow: hidden; position: fixed; right: 10px; width: 110px; z-index: 999;}.back-to .back-top { background: url("./images/top.jpg") no-repeat scroll 0 0 transparent; display: block; float: right; height: 50px; margin-left: 10px; outline: 0 none; text-indent: -9999em; width: 50px;}.back-to .back-top:hover { background-position: -50px 0}

DIV:

Javascript代码:

$(function () { var bt = $(#toolBackTop); var sw = $(document.body)[0].clientWidth; var limitsw = (sw - 840) / 2 - 80; //距离右侧距离 if (limitsw > 0){limitsw = parseInt(limitsw);bt.css("right",limitsw/8); } $(window).scroll(function() {var st = $(window).scrollTop();if(st > 30){ bt.show();}else{ bt.hide();} });});

前提:首先引入jQuery

效果展示:

按钮图片:

html教学

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。