(function($){
//返回顶部和底部插件
$.fn.extend({
goTopBootom:function (options){
//默认参数
var defaults = {
"upBtn":".up", //被点击返回顶部的按钮
"downBtn":".down", //被点击返回底部的按钮
"inTms":300, //此功能元素出现的时间
"outTms":300, //此功能元素隐藏的时间
"speed":500 //返回顶部或者底部的速度
};
var options = $.extend(defaults,options)
return this.each(function(){
var _this = $(this);
var oHtmlBody = $('html,body');
var oBodyH = document.body.clientHeight;
var oUp = $(this).find(options.upBtn);
var oDown = $(this).find(options.downBtn);
$(this).css("top",window.screen.availHeight/2-100+"px");
$(window).scroll(function() {
if($(window).scrollTop() >= 200){
_this.fadeIn(options.inTms);
}else{
_this.fadeOut(options.inTms);
}
});
oUp.click(function(){oHtmlBody.animate({scrollTop: '0px'}, options.speed);});
oDown.click(function(){oHtmlBody.animate({scrollTop: oBodyH + 'px'}, options.speed);});
});
},
//解决ie6下fixed插件
ie6fixedbug: function () {
return this.each(function(){
var m = (window.screen.height - $(this).height()) / 3;
var obj = $(this);
$(window).scroll(function () {
obj.css("top",(document.body.scrollTop || document.documentElement.scrollTop) + m + 'px');
});
$(window).resize(function () {
obj.css("top",(document.body.scrollTop || document.documentElement.scrollTop) + m + 'px');
});
});
}
});
}(jQuery));

jquery返回顶部和底部插件和解决ie6下fixed插件的更多相关文章

  1. jQuery返回顶部(精简版)

    jQuery返回顶部(精简版) <!DOCTYPE html><html lang="en"><head> <meta charset=& ...

  2. jquery返回顶部,支持手机

    jquery返回顶部,支持手机 效果体验:http://hovertree.com/texiao/mobile/6/ 在pc上我们很容易就可以用scrollTop()来实现流程的向上滚动的返回到顶部的 ...

  3. jQuery&CSS 顶部和底部固定浮动工具栏 兼容IE6

    http://www.cnblogs.com/lhj588/archive/2013/04/02/2994639.html —————————————————————————————————————— ...

  4. 解决IE6下PNG透明的JS插件:DD_belatedPNG.js

    DD_belatedPNG是一款解决IE6下PNG透明的JS插件,支持background-position和background-repeat属性,支持伪类.使用方法: <!--[if lte ...

  5. 解决IE6下不支持 png24的透明图片问题

    常用的两种解决方案: 第一:使用IE滤镜解决 关键代码: css代码  _background:none;_filter:progid:DXImageTransform.Microsoft.Alpha ...

  6. 解决IE6下png图片透明度不显示的问题

    世界上最遥远的距离,不外乎我在搞前端,你却在用旧IE,现在随着XP要退休了,IE6的市场占有率应该也会逐步下滑.不过基于天朝人民的惰性以及企鹅微软的“扎篱笆”活动,做网站的朋友依旧不能忽视IE6的存在 ...

  7. 解决IE6下浮动层固定定位的经典方法

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  8. jQuery类级别插件--返回顶部,底部,去到任何部位

    先引入js:<script type="text/javascript" src="jquery.js" ></script><s ...

  9. jQuery返回顶部实用插件YesTop

    只需一句jQuery代码实现返回顶部效果体验:http://hovertree.com/texiao/yestop/ 使用方法:只需引用jQuery库和YesTop插件(jquery.yestop.j ...

随机推荐

  1. centos7下git的安装和配置

    git的安装: yum 源仓库里的 Git 版本更新不及时,最新版本的 Git 是 1.8.3.1,但是官方最新版本已经到了 2.9.2.想要安装最新版本的的 Git,只能下载源码进行安装. 1. 查 ...

  2. MVC ASP.NET MVC各个版本的区别

    ASP.NET MVC各个版本的区别 Net Framework4.5是不支持安装在window server 2003上,如非装请用net framework4.0; MVC1.0 publsh t ...

  3. C# WPF Webbrowser 强制所有网页链接在同一页面打开

    只要搞懂Winform的  WPF稍微改一改就可以了 主类:负责跳转的 using System; using System.Collections.Generic; using System.Com ...

  4. ubuntu14.04,安装docker(源代码管理工具)

    一,安装docker: 1,安装curl:在shell中执行:sudo apt-get install curl 2,shell中执行:curl -sSL https://get.daocloud.i ...

  5. Google浏览器历史版和下载地址

    Google浏览器历史版本下载地址https://www.slimjet.com/chrome/google-chrome-old-version.php google webdriver下载地址分享 ...

  6. Codeforces Round #545 (Div. 2)C(离散化,思维,PAIR排序)

    #include<bits/stdc++.h>using namespace std;int a[1007][1007];pair<int,int>p1[1007],p2[10 ...

  7. loj#6436. 「PKUSC2018」神仙的游戏(NTT)

    题面 传送门 题解 一旦字符串踏上了通配符的不归路,它就永远脱离了温暖的字符串大家庭的怀抱 用人话说就是和通配符扯上关系的字符串就不是个正常的字符串了比如说这个 让我们仔细想想,如果一个长度为\(le ...

  8. 【python】Python的logging模块封装

    #!/usr/local/python/bin # coding=utf-8 '''Implements a simple log library. This module is a simple e ...

  9. 微信小程序HTTPS - cenos apache 下安装SSL证书

    1.yum install mod_ssl 2.接下来,我们需要创建一个新目录,我们将存储服务器密钥和证书 mkdir /root/ssl 3.vi /etc/httpd/conf.d/ssl.con ...

  10. linux系统安全及应用——PAM安全认证

    一.PAM认证模块介绍 PAM认证模块,叫做可插拔式的认证模块.一项重要的功能就是为了加强su命令的使用控制,可以借助于PAM认证模块,只允许极个别用户使用su命令进行切换.PAM提供了对所有服务进行 ...