function bannersize(){ var w=$(window).width(); var h=$(window).height(); if(w>1200){ $(".bannerslide,.bannerslide .slide_ul li").css({width:w,height:(31*w)/66}); $(".bannerslide .slide_ul li a img").css({width:w,height:(31*w)/96}); }else{ $(".bannerslide,.bannerslide .slide_ul li").css({width:1200,height:(31*1200)/96}); $(".bannerslide .slide_ul li a img").css({width:1200,height:(31*1200)/96}); } } /** * 阅读页字体放大缩小 * @return */ $(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"}) } }) }) //酷播迷你cuplayerminiv4.0/代码开始 function videoplayer(videourl,videoimg,videow,videoh){ var so = new swfobject("flash/cuplayerminiv20_black_s.swf", "cuplayer", videow, videoh, "9", "#000000"); so.addparam("allowfullscreen", "true"); so.addparam("allowscriptaccess", "always"); so.addparam("wmode", "opaque"); so.addparam("quality", "high"); so.addparam("salign", "lt"); so.addvariable("cuplayerfile",videourl); so.addvariable("cuplayershowimage", "false"); so.addvariable("cuplayerimage",videoimg);//视频略缩图,本图片文件必须正 so.addvariable("cuplayerwidth", videow); so.addvariable("cuplayerheight", videoh); so.addvariable("cuplayerautoplay", "false"); so.addvariable("cuplayerautorepeat", "false"); so.addvariable("cuplayershowcontrol", "true"); so.addvariable("cuplayerautohidecontrol", "false"); so.addvariable("cuplayerautohidetime", "6"); so.addvariable("cuplayervolume", "80"); so.write("cuplayer"); } function clickplayer(videodiv,videow,videoh){ $(videodiv).find("a").click(function(){ var videourl=$(this).attr("rel") var videoimg=$(this).attr("data-img") videoplayer(videourl,videoimg,videow,videoh) }) } //酷播迷你cuplayerminiv4.0/代码结束 /*选项卡方法*/ 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 tabsurl(tabsurlclass){ var title1tab=$(tabsurlclass).children("li") title1tab.hover(function(){ var url=$(this).find("a").attr("href") $(this).parents("ul").siblings("a").attr("href",url) }) } $(document).ready(function(){ //首页导航 $('.menu dd').hover(function(){ $('.menu dd.hover').addclass("active").removeclass("hover") $(this).addclass("hover") },function(){ $(this).removeclass("hover") $('.menu dd.active').addclass("hover").removeclass("active") }); $(".menu dd").each(function(index, element) { $(this).hover(function(){ $(this).find("div.div").stop().slidedown(500); },function(){ $(this).find("div.div").stop().slideup(500); }) }); $(".menu dd").each(function(index, element) { $(this).find(".div a:last").css("border-bottom","none") }); //首页banner $(".bannerslide").slide({ maincell:".slide_ul", titcell:".hd ul", titonclassname:"on",//当前状态 on进度条效果 cur选中效果 effect:"fold", //左循环滚动 fold:淡入淡出 toploop:上循环滚动; leftloop:左循环滚动; delaytime: 3000, //切换时间 intertime:5000, //切换间隔 autopage:true, autoplay:true, }); bannersize(); $(".bannerslide").hover( function(){ $(this).find(".prev").stop(true,true).animate({left:"47%",opacity:1},500) $(this).find(".next").stop(true,true).animate({right:"47%",opacity:1},500) },function(){ $(this).find(".prev").stop(true,true).animate({left:"40%",opacity:0},500) $(this).find(".next").stop(true,true).animate({right:"40%",opacity:0},500) }) //焦点图 $(".focus").slide({ titcell:".hd ul",maincell:".bd ul",autopage:true,delaytime: 1000,intertime: 3000,effect:"fold",autoplay:true, startfun:function(i){ var aaa=$(".focus .bd li").eq(i).attr("dir") $(".textbg").text(aaa) } }); //选项卡调用 tabs(".tabs ul",".tabs_con","hover"); tabs(".tabs2 ul",".tabs2_con","hover"); tabsurl(".tabs2 ul") $(".productdl").slide({ maincell:".bd dl",autopage:true,delaytime: 1000,intertime: 3000,effect:"leftloop",autoplay:false,vis:4,prevcell:".prev",nextcell:".next" }); $(".productdl dd").each(function(index, element) { $( this).hover(function(){ $(this).find(".a1").stop(true,true).animate({bottom:0},500); },function(){ $(this).find(".a1").stop(true,true).animate({bottom:-200},500); }) }); //leftnav $(".leftnav dd:last").find("a").css("border","none") //location $(".location p a:last").addclass("on") //招聘页 $(".recruitlistdl dd:even").css("background","none"); $(".recruitlistdl dd").find("span:last").css("border","none"); $(".recruitlistdl dt").find("span:last").css("border","none"); //综合页 $(".comdl dd").each(function(index, element) { $(this).hover(function(){ $(this).find(".divbox").stop(true,true).animate({top:-220},500) },function(){ $(this).find(".divbox").stop(true,true).animate({top:0},500) }) }); //头部广告 $(".adbox .close").click(function(){ $(this).parents(".adbox").stop(true,true).animate({height:0},500); }) settimeout("$('.adbox').animate({height:0},500)", 30000) //投票 $(".vote_dl dd").each(function(index, element) { $(this).find(".checkbox").toggle(function(){ $(this).addclass('hover'); },function(){ $(this).removeclass('hover'); }) }); //底部广告 $(".f_focus").slide({ titcell:".hd ul",maincell:".bd ul",autopage:true,delaytime: 1000,intertime: 3000,effect:"fold",autoplay:true, }); $(".f_focus .close").click(function(){ $(".f_focus").animate({bottom:-200},500) }) }); $(window).resize(function(){ bannersize(); });