//图片等比缩放 function scaleimg(){ $(".scalebox").each(function(){ $(this).find("img").jqthumb({ width: $(this).outerwidth(), height: $(this).outerheight(), after: function(imgobj){ imgobj.css('opacity', 1).animate({opacity: 1},1000); } }); }) } /** * tabs * @return */ function tabs(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; }); } /** * tabs2 * @return */ function tabs2(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 selected(selectdiv){ $(selectdiv).find("em").click(function(){ $(this).siblings().slidedown(); $(this).siblings().find("a").click(function(){ var selecttext=$(this).text() $(this).parent().siblings("em").text(selecttext) $(this).parent().siblings("input").attr("value",selecttext) $(this).parent().css("display","none") }) }) $(selectdiv).hover(function(){},function(){ $(this).find("div").slideup(); }) } /* *字体大小 */ $(function(){ var fontsize=$(".articletime 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;i