/*全局js*/ $(document).ready(function() { /*左侧等高*/ window.setTimeout(function() { $('.navbar,.sidebar').height($(document).height()); }, 500); /*左侧展开/收缩*/ $('.bar-toggle').click(function() { var bt = $(this), sbr = $('.sidebar'); if (!bt.hasClass('on')) { bt.addClass('on'); sbr.animate({marginLeft:0}, 300); } else { bt.removeClass('on'); sbr.animate({marginLeft:-sbr.width()}, 300); } sbr = bt = null; }); /*qq,weibo等弹窗效果*/ $('.qq').hover(function() { $(this).find('.block').show(); $(this).find('.icon').css({'background-position-y':'-34px'}); }, function() { $(this).find('.block').hide(); $(this).find('.icon').css({'background-position-y':0}); }); $('.qq_weibo').hover(function() { $(this).find('.block').show(); $(this).find('.icon').css({'background-position-y':'-34px'}); }, function() { $(this).find('.block').hide(); $(this).find('.icon').css({'background-position-y':0}); }); $('.qq_weixin').hover(function() { $(this).find('.block').show(); $(this).find('.icon').css({'background-position-y':'-34px'}); }, function() { $(this).find('.block').hide(); $(this).find('.icon').css({'background-position-y':0}); }); $('.weibo').hover(function() { $(this).find('.block').show(); $(this).find('.icon').css({'background-position-y':'-34px'}); }, function() { $(this).find('.block').hide(); $(this).find('.icon').css({'background-position-y':0}); }); $('.backtop').hover(function() { $(this).find('.icon').css({'background-position-y':'-34px'}); $(this).click(function() { $('html,body').animate({scrollTop:0},100); }); }, function() { $(this).find('.icon').css({'background-position-y':0}); }); });