/*右侧浮动工具*/ $(function(){ $('#toolbar dd').bind({ 'mouseenter': function () { if ($(this).children('.slide').length) { var _this = $(this).children('.slide'); _this.show().animate({ 'right': 65 }, 180); } else if ($(this).children('.pop').length) { var _this = $(this).children('.pop'); _this.show().animate({ 'right': 65 }, 180); } }, 'mouseleave': function () { if ($(this).children('.slide').length) { var _this = $(this).children('.slide'); _this.hide().animate({ 'right': 65 },180); } else if ($(this).children('.pop').length) { var _this = $(this).children('.pop'); _this.hide().animate({ 'right': 65 },180); } } }); $("#toolbar .tanbtn").click(function(){ $(".dig").show(); layout(1); $('.dig .d_tit').find("b").text($(this).text()); }) $(".dig .icon_close").click(function(){ $(".dig").hide(); layout(0); }) /*$("#gotop").click(function() { $("body, html").stop().animate({ "scrollTop": 0 }); });*/ }); $( function () { var speed = 1000;//自定义滚动速度 //回到顶部 $( "#toTop").click( function () { $( "html,body").animate({ "scrollTop" : 0 }, speed); }); //回到底部 var windowHeight = parseInt($("body").css("height" ));//整个页面的高度 $( "#toBottom").click(function () { $( "html,body").animate({ "scrollTop" : windowHeight }, speed); }); });