发传单

$(function() { var tabBtn = $(".tab-btn li"); var tabCon = $(".topArticle-con"); for( var i = 0; i < tabBtn.length; i++){ tabBtn[i].index = i; tabBtn[i].onmouseover = function(){ for(var k = 0; k < tabBtn.length; k++){ tabCon[k].style.display = "none"; tabBtn[k].className = ""; }; tabCon[this.index].style.display = "block"; this.className = "highlight"; } } }); jQuery(document).ready(function($) { $.fn.smartFloat = function() { var position = function(element) { var top = element.position().top, offset = element.offset().top, pos = element.css("position"); $(window).scroll(function() { var scrolls = $(this).scrollTop(); if (scrolls > offset - 10) { if (window.XMLHttpRequest) { element.css({ position: "fixed", top: 10 }); } else { element.css({ top: scrolls }); } } else { element.css({ position: "static", top: top }); } }); }; return $(this).each(function() { position($(this)); }); }; $(".share").smartFloat(); }); jQuery(document).ready(function($) { /* * 加载更多 * */ $(".loadMore").on('click',function(){ $('.more-data').css('display','block'); $(this).css('display','none'); }); $('.wechat').hover(function () { $('.share_qrcode').css('display','block'); }, function () { $('.share_qrcode').css('display','none'); }) $('.share_qrcode').qrcode({ width: 140, height: 140, text:window.location.href }); $('.hyh_2').on('click', function (e) { var _this = $(this); _this.siblings('.like_body1').children('.like_box').animate({"left":"-680px"}, function () { _this.siblings('.like_body1').children('.like_box').children('ul').eq(0).appendTo(_this.siblings('.like_body1').children('.like_box')); _this.siblings('.like_body1').children('.like_box').css('left',0); }); _this.siblings('.like_body2').children('.like_box').animate({"left":"-680px"}, function () { _this.siblings('.like_body2').children('.like_box').children('ul').eq(0).appendTo(_this.siblings('.like_body2').children('.like_box')); _this.siblings('.like_body2').children('.like_box').css('left',0); }); }); $.fn.smartFloat = function() { var position = function(element) { var top = element.position().top, offset = element.offset().top, pos = element.css("position"); $(window).scroll(function() { var scrolls = $(this).scrollTop(); if (scrolls > offset) { if (window.XMLHttpRequest) { element.css({ position: "fixed", top: 10 }); } else { element.css({ top: scrolls }); } } else { element.css({ position: "static", top: 0 }); }; if($(".media-left .share").offset().top > $(".sidebar").offset().top - $(".media-left .share").height() - 40){ $(".media-left .share").css({ position: "absolute" }); } }); }; return $(this).each(function() { position($(this)); }); }; $(".sidebar").smartFloat(); $(".ad").smartFloat(); $(".media-left .share").smartFloat(); });
0