爱易网
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 浏览次数:20114 次
以下是程序代码
<!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
上一篇:狡猾的按钮特效
下一篇:加入网摘悬浮左侧效果
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
首家国有独资P2P平台上线 或预示政策日渐明朗
频繁自杀 折射媒体变革中的媒体人迷茫与压力并存
苏宁易购成世界最慢电商 专家称其涉嫌违约
唯品会股价飙升 引天猫当当京东进军闪购
看病也能用支付宝了 马云的又一盘大棋
618首日看京东阿里不同策略,鹿死谁手?
途牛开盘价9美元 与发行价持平
《中国三网融合业务运营管理》研讨报告征订函
埃里克杰克森:阿里IPO估值至少1500亿美元
推荐阅读
更多>
2013年至今中国互联网行业十大并购案汇总
金山毒霸安全中心: XP退役后首个高危漏洞来了
支付宝钱包支持医保移动缴费 广州成首个试点
中国联通困局:遭遇OTT宽带4G三大难题
聚美向左,唯品向右,怎能耐得住高跟和红唇的诱惑!
估值增长9.8% 阿里IPO前市值达2450亿美元
百度透露无人驾驶战略 研发三维交通地图
从WPS到office365,中国企业能否赶超美国?
微软谷歌高层访韩面前:忌惮三星的崛起
携程艺龙联手死磕同程 价钱烽烟蔓延至机票
AMD Q1净亏1.46亿美元 转战SOC拥抱ARM求变
三星起诉LG在冰箱广告中玷污其企业笼统
优酷土豆携手新浪微博 谋攻移动视频失地
QQ空间与微信龟兔赛跑,商业生态链陷入死循环
网络视频的几大趋势将成视频玩家躲不开的发力点
快播灭了,还有西瓜:视频网站的灰色江湖还在
电话用户9月实名制:运营商监管受质疑
NEC拟出售移动效劳子公司NEC Mobile
微信今天大面积崩溃 腾讯:因光缆施工被挖断
同程旅游融资后变土豪 如何烧钱占领市场?