爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
兼容多种浏览器的返回顶部特效
兼容多种浏览器的返回顶部特效
日期:2014-05-18 浏览次数:20173 次
以下是程序代码
<!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=gb2312"> <meta name="keywords" content="站长,网页特效,网页特效代码,js特效,js脚本,脚本,广告代码,zzjs,zzjs.net,www.zzjs.net,站长特效 网" /> <meta name="description" content="www.zzjs.net,站长特效网,站长必备js特效及广告代码。大量高质量js特效,提供高质量广告代码下载,尽在站长特效网" /> <title>网页特效 仿淘宝网回顶部效果 站长特效网欢迎您.</title> <script type="text/javascript" src="/img/jquery_zzjs.js"></script> <script type="text/javascript"> var scrolltotop={ //startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control //scrollto: Keyword (Integer, or "Scroll_to_Element_ID"). How far to scroll document up when control is clicked on (0=top). setting: {startline:1, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]}, controlHTML: '<img src="/img/up_20100814.png" style="width:24px; height:24px" />', //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol" controlattrs: {offsetx:5, offsety:5}, //offset of control relative to right/ bottom of window corner anchorkeyword: '#top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links state: {isvisible:false, shouldvisible:false}, scrollup:function(){ if (!this.cssfixedsupport) //if control is positioned using JavaScript this.$control.css({opacity:0}) //hide control immediately after clicking it var dest=isNaN(this.setting.scrollto)? this.setting.scrollto : parseInt(this.setting.scrollto) if (typeof dest=="string" && jQuery('#'+dest).length==1) //check element set by string exists dest=jQuery('#'+dest).offset().top else dest=0 this.$body.animate({scrollTop: dest}, this.setting.scrollduration); }, keepfixed:function(){ var $window=jQuery(window) var controlx=$window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx var controly=$window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety this.$control.css({left:controlx+'px', top:controly+'px'}) }, togglecontrol:function(){ var scrolltop=jQuery(window).scrollTop() if (!this.cssfixedsupport) this.keepfixed() this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false if (this.state.shouldvisible && !this.state.isvisible){ this.$control.stop().animate({opacity:1}, this.setting.fadeduration[0]) this.state.isvisible=true } else if (this.state.shouldvisible==false && this.state.isvisible){ this.$control.stop().animate({opacity:0}, this.setting.fadeduration[1]) this.state.isvisible=false } }, init:function(){ jQuery(document).ready(function($){ var mainobj=scrolltotop var iebrws=document.all mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body') mainobj.$control=$('<div id="topcontrol">'+mainobj.controlHTML+'</div>') .css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, opacity:0, cursor:'pointer'}) .attr({title:'Scroll Back to T
上一篇:狡猾的按钮特效
下一篇:加入网摘悬浮左侧效果
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
解析2014年阿里百度等五大互联网巨头深度布局
索尼移动中国区陷裁员风波:业务不佳 员工焦虑
智能手机:中国手机市场最受关注十五款产品清点
京东物流"最后一公里":颠覆阿里或者被阿里干掉
黑狐病毒疯传播 电脑管家首推 专杀工具
三星已经将Galaxy S5视为失败之作?
三大运营商获通知大减营销费 传3年减400多亿
苹果售后生态链乱象:供需失衡价钱不一
二代 iPad Air将配备2GB内存?为同屏多任务做准备
推荐阅读
更多>
二代 iPad Air将配备2GB内存?为同屏多任务做准备
神奇约炮应用被禁 改名后重返苹果应用商店
揭秘:阿里巴巴“无人认领”的三成股权都归谁
工信部或本月17日向联通电信颁发FDD牌照
从旗下三大业务BG发展看华为的过去现在和未来
腾讯再次重申:普通微信誉户相对不收费
联发科享用价钱战 专利难以摆脱高通
频繁自杀 折射媒体变革中的媒体人迷茫与压力并存
华为任正非:家族成员不会成为接班人
广电总局回应美剧下架:不是所有信息可公开
携程艺龙联手死磕同程 价钱烽烟蔓延至机票
流浪汉高考状元终于找到工作:月薪3000做程序员很满意
曹国伟:微博将关注Facebook和Twitter
中移动一季度净利大降:手机补贴增长过快
惠普中国转型只是缩影 未来开展不可预期
FDD牌照短期不会发放 联通电信暗自提速建网
郭美美事件推手被抓 “秦火火”拷问网络底线
看蜗牛如何放水养鱼,盘活生态系统
蜗牛移动董事长石海:号卡被叫停属乌龙事件
解读苹果收购Beats背后动机:库克在想什么?