//tab切换 function tabs(tabtitle,tab_content,event){ var index=$(tabtitle).children(".hover").index() $(tab_content).children().eq(index).show().siblings().hide(); $(tabtitle).children().bind(event,function(){ var index=$(this).index(); $(this).addclass("hover").siblings().removeclass("hover"); $(tab_content).children().eq(index).show().siblings().hide(); return false; }); } function tabs1(tabtitle,tab_content,event){ var index=$(tabtitle).children(".hover").index() $(tab_content).children().eq(index).addclass("active").siblings().removeclass("active"); $(tabtitle).children().bind(event,function(){ var index=$(this).index(); $(this).addclass("hover").siblings().removeclass("hover"); $(tab_content).children().eq(index).addclass("active").siblings().removeclass("active"); return false; }); } function tabsm(tabtitle,tab_content,tabmore,event){ var index=$(tabtitle).children(".hover").index(); var tabhref = $(tabtitle).children(".hover").find('a').attr('href'); $(tab_content).children().eq(index).show().siblings().hide(); if(tabmore != "" || tabmore != undefined ){ $(tabmore).attr('href',tabhref); } $(tabtitle).children().bind(event,function(){ var index=$(this).index(); var tabhref = $(this).find('a').attr('href'); if(tabmore != "" || tabmore != undefined ){ $(tabmore).attr('href',tabhref); } $(this).addclass("hover").siblings().removeclass("hover"); $(tab_content).children().eq(index).show().siblings().hide(); return false; }); } /*选择框*/ function stoppropagation(event){ e=window.event||event; if(document.all){e.cancelbubble=true;}else{e.stoppropagation();e.stopimmediatepropagation();} } function select(demo){ $(demo).attr("val",0); $("body").on('click',demo,function(event){ var nowtext=$(this).find(".seljg").html().replace(/\s*/g,"") $(this).find(".seltj a").each(function(index, element) { var thishtml=$(this).html() if(thishtml===nowtext){$(this).addclass("hover").siblings().removeclass("hover")}}); var val=$(this).attr("val") if(val==0){$(this).find(".seltj").show().parents(demo).attr("val",1)}else{$(this).find(".seltj").hide().parents(demo).attr("val",0)} $(demo).not(this).attr("val",0) $(demo).not(this).find(".seltj").hide() //stoppropagation(event) return false; }) $("body").on("click",".seltj a",function(){ //$(".seltj a").click(function(){ var text=$(this).html() $(this).parents(demo).attr("val",0) $(this).parent().hide().siblings(".seljg").html(text).siblings("input").attr("value",text) //stoppropagation(event) return false; }) $(document).click(function(){ $(".seltj").hide() $(demo).attr("val",0) }) } /* *字体大小 */ $(function(){ var fontsize=$(".article_time span") var articlebox=$(".articlebox") fontsize.click(function(){ $(this).addclass("hover").siblings().removeclass("hover") var fonthtml=$(this).html(); if(fonthtml=="小") { articlebox.css({"font-size":"12px"}) } else if((fonthtml=="中")) { articlebox.css({"font-size":"14px"}) } else if((fonthtml=="大")) { articlebox.css({"font-size":"18px"}) } }) }) //wow 同一行 元素延迟加载 function wowdelay(box,row,delaytime){ $(box).children().each(function(index){ for(var i = 0;ioh){ _this.find("img").css({ "width":"auto", "height":h, "margin-top":-h/2, "margin-left":-ow/oh*h/2 }); }else if(ow