/** * tabs * @return */ 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(){ var fontsize=$(".article_time span") var articlebox=$(".article") 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"}) } }) }); //图片等比缩放 function scaleimg(){ $('.scalebox img').jqthumb({ width: $('.scalebox').outerwidth(), height: $('.scalebox').outerheight(), after: function(imgobj){ imgobj.css('opacity', 1).animate({opacity: 1},1000); } }); } //图片自适应居中 function autoimg(){ $('.autoimg').each(function(){ var _w = $(this).outerwidth(); var _h = $(this).outerheight(); var scale1 = _h/_w; var imgw = $(this).find('img').width(); var imgh = $(this).find('img').height(); var scale2 = imgh/imgw; if(scale2>=scale1){ $(this).find('img').css({'height':'100%','left':'50%','top':'0px','margin-left':-((_h/scale2)/2)+'px','transform':'translate(0px,0px)'}); }else{ $(this).find('img').css({'width':'100%','top':'50%','left':'0px','margin-top':-((_w*scale2)/2)+'px','transform':'translate(0px,0px)'}); } }); } //wow 同一行 元素延迟加载 function wowdelay(box,row,delaytime){ $(box).children().each(function(index){ for(var i = 0;i1){ $(".ind1rdl").slide({ titcell: ".hd ul", maincell: ".bd dl", autoplay:true, //自动播放 effect:"leftloop", //左循环滚动 fold:淡入淡出 toploop:上循环滚动; leftloop:左循环滚动; delaytime: 1000, //切换时间 intertime: 5000, //切换间隔 autopage: true, //自动分页 trigger: "click", prevcell: ".prev", nextcell: ".next", vis: 1 }); }; select(".msg_input1"); //等比缩 scaleimg(); }); $(window).resize(function(){ }); $(window).load(function(){ });