1 line
1.3 KiB
JavaScript
1 line
1.3 KiB
JavaScript
var Finding={init:function(){Util.killIE(),$(".scroll-down").click(function(t){t.preventDefault();var o=$(this),n=$("html, body"),e=o.attr("data-offset")?o.attr("data-offset"):!1,a=parseInt(e);n.stop(!0,!1).animate({scrollTop:$(this.hash).offset().top+a},500)}),$("body").click(function(t){0===$(t.target).closest(".nav").length&&$("body").hasClass("nav-opened")&&!$(t.target).hasClass("icon-gotop")&&$("body").removeClass("nav-opened").addClass("nav-closed")}),$(".menu-button").click(function(t){t.stopPropagation(),$("body").toggleClass("nav-opened nav-closed")}),$("body").append('<a class="icon-gotop fn-none" href="javascript:Util.goTop()"></a>'),$(window).scroll(function(){$(window).scrollTop()>$(window).height()?$(".icon-gotop").show():$(".icon-gotop").hide()})},share:function(){$(".share span").click(function(){var t=$(this).data("type"),o=encodeURIComponent($("title").text()),n=$(".post-title a").attr("href")?$(".post-title a").attr("href"):location,e=$(".post-content img:eq(0)").attr("src"),a={};a.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+o+"&url="+n+"&pic="+e,a.weibo="http://v.t.sina.com.cn/share/share.php?title="+o+"&url="+n+"&pic="+e,a.google="https://plus.google.com/share?url="+n,a.twitter="https://twitter.com/intent/tweet?status="+o+" "+n,window.open(a[t],"_blank","top=100,left=200,width=648,height=618")})}};Finding.init(); |