Fork me on GitHub
  2017年2月4日
摘要: 前言 前言 我是一个乐于沟通的人,认为“矛盾不是问题,需要及时沟通”,尤其是出现冲突时,我会倾向于袒露自己的想法,寻求沟通以解决问题。但是前任是一个有不开心的事喜欢一个人装在心里,认为“一份烦恼说出去就是两份烦恼”,喜欢一个人消化消极情绪。这就导致,我们出现矛盾时,我会不停追问原因,渴望通过沟通来解 阅读全文
posted @ 2017-02-04 11:34 馬小妹 阅读(8881) 评论(0) 推荐(1) 编辑

/* * 功能: 创建一个可以让页面滚动到顶部的按钮, 常见于各种社交网站的微博列表. * 备注: DOM被设置成了浮动的, 用户可以自己设定位置, 传入right, bottom参数即可 还可以配置滚到条到多高的时候会显示插件图标. */ (function ($) { $.fn.scrolltop = function (options) { var opts = $.extend({}, $.fn.scrolltop.defaults, options); var run2top = function () { var scrollDist = $(window).scrollTop(); if (scrollDist > 0) { scrollDist -= opts.topSpeed; scrollDist = Math.max(scrollDist, 0); $(window).scrollTop(scrollDist); setTimeout(run2top, 1); } }; return this.each(function () { var $this = $(this); $this.css("opacity", "0.3"); $this.css("background", "url('u=4251301862,936291425&fm=214&gp=0.jpg') no-repeat"); $this.css("width", opts.width); $this.css("height", opts.height); $this.css("position", "fixed"); $this.css("right", opts.right); $this.css("bottom", opts.bottom); $this.hover( function () { $(this).css('opacity', '1.0'); }, function () { $(this).css('opacity', '0.5'); } ); $this.click(function () { //$(window).scrollTop(0); run2top(); }); $(window).scroll(function () { var scrollDist = $(window).scrollTop(); if (scrollDist >= opts.heightThreshhold) { //当滚动条离顶部超过阈值的时候, 就显示 $this.css("display", "block"); } else { $this.css("display", "none"); } }); }); }; $.fn.scrolltop.defaults = { heightThreshhold: 1000, width: "50px", height: "50px", right: "8%", bottom: "30px", topSpeed: 50 }; })(jQuery);