// javascript document $(function () { //$("#rightdiv").css("top", $(window).scrolltop() + ($(window).height() - $("#rightdiv").height()) / 2); //$(window).scroll(function () { gotop(); }); //拖动滚动条 自动居中 //$(window).resize(function () { gotop(); }); //拖动窗口 自动居中 /*$("#rightdiv .toptop").click(function(){ $("html,body").animate({ scrolltop: 0 }, 1000); });*/ var _$tel = $("#rightdiv li").eq(3); _$tel.hover( function(){ _$tel.find(".tel").hide(); _$tel.find(".tel_2").css({"width":75,"left":0}).stop().show().animate({"width":285,"left":0}); }, function(){ _$tel.find(".tel_2").stop().animate({"width":75,"left":0},function(){ _$tel.find(".tel").show(); _$tel.find(".tel_2").hide(); }); } ); var _$wx = $("#rightdiv li").eq(2); _$wx.hover( function(){ var w_1 = 200; var h_1 = 230; _$wx.find(".wxbox").css({"width":0,"height":0,"opacity":0}); _$wx.find(".wxbox").stop().show().animate({"width":w_1, "height":h_1,"opacity":1},300); }, function(){ _$wx.find(".wxbox").stop().animate({"width":0, "height":0,"opacity":0},300,function(){ $(this).hide(); }); } ); }); function gotop() { $("#rightdiv").stop().animate({ "top": $(window).scrolltop() + ($(window).height() - $("#rightdiv").height()) / 2 }, 500); }