// 页面滚动距离顶部大于120像素后,Header高度相应减小。 $(document).on("scroll",function(){ if($(document).scrollTop()>120){ // 固定顶部菜单栏顶部显示 $("header").fadeIn(function(){ $(this).addClass('navbar-fixed-top animated fadeInDown header-fixed-top'); }); // 返回顶部工具条显示 $("#tool-box").fadeIn(function(){ $(this).removeClass('hide'); }); }else{ // 顶部菜单栏样式复原 $("header").fadeIn(function(){ $(this).removeClass('navbar-fixed-top animated fadeInDown header-fixed-top'); }); // 返回顶部工具条隐藏 $('#tool-box').fadeOut(function(){ $(this).addClass('hide'); }); } }); // 菜单鼠标悬停显示,离开隐藏。 $('li.dropdown').mouseover(function() { $(this).addClass('open'); $(this).children('.dropdown-toggle').children('span').removeClass('caret-left'); $(this).children('.dropdown-toggle').children('span').addClass('caret'); }).mouseout(function() { $(this).removeClass('open'); $(this).children('.dropdown-toggle').children('span').removeClass('caret'); $(this).children('.dropdown-toggle').children('span').addClass('caret-left'); }); // 返回顶部工具条 - 点击返回页面顶部 $('#tool-box .return-top').on('click',function(){ $('html,body').animate({'scrollTop':0},500); }); // 返回顶部工具条 - 鼠标悬停显示微信二维码 $('#tool-box .wechat').hover(function(){ $('#tool-box .wechat-pop').removeClass('hide'); },function(){ $('#tool-box .wechat-pop').addClass('hide'); }); // 金沙集团3354.c.c首页文章缩略图悬停标题显示效果 $('.home-post').hover(function() { $(this).children('.article-meta-area').removeClass('hide animated fadeOutDown'); $(this).children('.article-meta-area').addClass('animated slideInUp'); },function(){ $(this).children('.article-meta-area').addClass('hide animated fadeOutDown'); $(this).children('.article-meta-area').removeClass('animated slideInUp'); }); // 文章分享 - 鼠标悬停显示微信二维码 $('.social-share-wechat').hover(function(){ $('.post-qrcode').removeClass('hide'); },function(){ $('.post-qrcode').addClass('hide'); }); // Bootstrap 框架文章配图大小自适应样式,避免小于图片分辨率浏览时出现图片拉伸现象。 // $(".entry img").addClass("carousel-inner img-responsive img-rounded");