/*search*/ $(".search_icon").click(function(e){ $("#pop_search").css({left:$(this).offset().left, top:$(this).offset().top-3}).addClass("open"); e.stopPropagation(); }); $("body").click(function(){ $("#pop_search").removeClass("open"); }); $("#pop_search").click(function(e){ e.stopPropagation(); }); $("#tptt").jcarousel({auto:3,wrap:"circular",hasControl:true, buttonPrevHTML: null, buttonNextHTML: null, initCallback: function(carousel){ $("#tptt li").each(function(i){ $(".jcarousel-skin-tptt .jcarousel-control span").eq(i).html($(this).html()); }); $(".jcarousel-skin-tptt .jcarousel-control span").hover(function(){ carousel.stopAuto(); carousel.scroll($(this).index()+1, false); },function(){ carousel.startAuto(); }); $(".jcarousel-skin-tptt").append($('
')); }, itemVisibleInCallback: {onBeforeAnimation: function(carousel, item, idx){ $(".smask").css("top", (4-(5-idx%5)%5)*$(".smask").innerHeight()+10); }}}); $("#kd").jcarousel({auto: 3, vertical: true, buttonPrevHTML: null, buttonNextHTML: null}); $("#gdxw").liMarquee({scrollamount:50}); $("#sp").jcarousel({auto: 2, hasControl: false}); $("#cp").jcarousel({auto: 2, buttonPrevHTML: null, buttonNextHTML: null}); $("#dbswiper").jcarousel({auto: 4, hasControl: true}); $("#banner0").jcarousel({ animation: 0, auto: 2, vertical: true, buttonPrevHTML: null, buttonNextHTML: null, hasControl: true}); $("#tonglan_0").jcarousel({ animation: 0, auto: 2, vertical: true, buttonPrevHTML: null, buttonNextHTML: null, hasControl: true, ControlType: "number" }); $("#tonglan_1").jcarousel({ animation: 0, auto: 2, vertical: true, buttonPrevHTML: null, buttonNextHTML: null, hasControl: true, ControlType: "number" }); $("#tonglan_3").jcarousel({ animation: 0, auto: 2, vertical: true, buttonPrevHTML: null, buttonNextHTML: null, hasControl: true, ControlType: "number" }); $("#tonglan_4").jcarousel({ animation: 0, auto: 2, vertical: true, buttonPrevHTML: null, buttonNextHTML: null, hasControl: true, ControlType: "number" }); $("#erlan1_1").jcarousel({ animation: 0, auto: 2, vertical: true, buttonPrevHTML: null, buttonNextHTML: null, hasControl: true, ControlType: "number" }); $("#erlan1_2").jcarousel({ animation: 0, auto: 2, vertical: true, buttonPrevHTML: null, buttonNextHTML: null, hasControl: true, ControlType: "number" }); $("#tonglan_3_left").jcarousel({ animation: 0, auto: 2, vertical: true, buttonPrevHTML: null, buttonNextHTML: null, hasControl: true, ControlType: "number" }); $("#tonglan_3_mid").jcarousel({ animation: 0, auto: 2, vertical: true, buttonPrevHTML: null, buttonNextHTML: null, hasControl: true, ControlType: "number" }); $("#tonglan_3_right").jcarousel({ animation: 0, auto: 2, vertical: true, buttonPrevHTML: null, buttonNextHTML: null, hasControl: true, ControlType: "number" }); /*宸ヤ細鎶ュ垔涓嬫媺*/ var dropDownTimer=[]; function dropDownClose(n) { $("#"+n).hide(); $(".dropdown[data-id='"+n+"']").removeClass("open"); } if ($(window).width()>980) { $(".dropdown").hover(function(){ window.clearTimeout(dropDownTimer[$(this).data("id")]); dropDownClose($(this).siblings(".open").data("id")); $(this).siblings(".open").removeClass("open"); $("#"+$(this).data("id")).css({left:$(this).offset().left,top:$(this).offset().top+$(this).height(),"min-width":$(this).innerWidth()-2}).show(); $(this).addClass("open"); }, function(){ var n=$(this).data("id"); dropDownTimer[n]=window.setTimeout(function(){ dropDownClose(n); }, 500); $("#"+n).hover(function(){ window.clearTimeout(dropDownTimer[n]); },function(){ dropDownTimer[n]=window.setTimeout(function(){ dropDownClose(n); }, 500); }); }); } else { $(".dropdown").click(function(){ $(this).siblings(".open").trigger("click"); $("#"+$(this).data("id")).css({left:$(this).offset().left,top:$(this).offset().top+$(this).height(),"min-width":$(this).innerWidth()-2}).toggle(); $(this).toggleClass("open",""); }); } /*鏌ヨ鎶ュ垔*/ var today=new Date(),i, weeks=["鏃?,"涓€","浜?,"涓?,"鍥?,"浜?,"鍏?], toyear=today.getFullYear(), tomonth=today.getMonth()+1, todayy=today.getDate(); tomonth=(tomonth>9?"":"0")+tomonth; todayy=(todayy>9?"":"0")+todayy; $("#today").text(toyear+"骞?+tomonth+"鏈?+todayy+"鏃ャ€€鏄熸湡"+weeks[today.getDay()]); for (i=2012;i<=toyear;i++) { $("#syear").append('"); } for (i=1;i<=12;i++) { $("#smonth").append('"); } genDays(toyear,tomonth,todayy); function maxDays(y,m) { var maxDay=new Date(y,m-1,1); maxDay.setMonth(maxDay.getMonth()+1); maxDay.setDate(maxDay.getDate()-1); return maxDay.getDate(); } function genDays(y,m,d) { d=d||document.getElementById("sday").value; $("#sday").html(""); for (i=1;i<=maxDays(y||document.getElementById("syear").value,m||document.getElementById("smonth").value);i++) { $("#sday").append('"); } } function wq() { var y=document.getElementById("syear").value, m=document.getElementById("smonth").value, d=document.getElementById("sday").value, sday=new Date(y,m-1,d); if (sday>today) { alert("鏃犳晥鐨勬棩鏈燂紝璇烽噸鏂伴€夋嫨銆?); return false; } window.open("/papers/grrb/"+y+"/"+(m>9?"":"0")+m+"/" + (d>=10?"":"0")+d +"/1/page.html"); } //宸ヤ汉鏃ユ姤鏉垮潡 var PAPER_API_HOME = "/papers"; var PAPER_DATA; var paperApiIndex = PAPER_API_HOME + "/grrb/index.json?t=" + Math.random(); $.getJSON(paperApiIndex, function (json) { //閫氳繃HTTP GET褰㈠紡鐨凙JAX璇锋眰鑾峰彇杩滅▼JSON缂栫爜鐨勬暟鎹€ para_date = json.index; downloadPaper('grrb', para_date, viewPaper); }); //鑾峰彇褰撴棩鐨勬姤绾镐俊鎭 function downloadPaper(type, date, viewPaper) { var dates = date.split("-"); var paperUrl = PAPER_API_HOME + "/" + type + "/" + dates[0] + "/" + dates[1] + "/" + dates[2] + "/index.json"; jQuery.support.cors = true; // IE8锛? 榛樿涓嶆敮鎸 CORS 璇锋眰锛岄渶瑕佹墜鍔ㄥ紑鍚笅 $.ajax({ cache: true, url: paperUrl, type: "GET", dataType: "json", success: function (res) { PAPER_DATA = res; if(PAPER_DATA.pageNum<1){ console.log("璇ユ湡鎶ョ焊涓嶅瓨鍦?); } viewPaper(); }, error: function () { console.log("璇ユ湡鎶ョ焊涓嶅瓨鍦?); } }); } function viewPaper() { wrapPageUrlList(); } function wrapPageUrlList() { var dt = PAPER_DATA.date.split("-"); for (var index = 0; index < PAPER_DATA.pages.length; index++) { if (index == 0) { $("#PageImage").attr("src","/papers/grrb/"+dt[0]+"/"+dt[1]+"/"+dt[2]+"/1/"+PAPER_DATA.pages[index].image); } var pagePdfUrl = PAPER_DATA.paperHomeUrl + "/" + (index + 1) + "/grrb" + dt[0] + dt[1] + dt[2] + (index + 1) + ".pdf"; var pageUrl = "/papers/grrb/"+dt[0]+"/"+dt[1]+"/"+dt[2]+"/"+(index + 1)+"/page.html"; if (index+1 < 10) { var href = "
  • 0" + (index + 1) + "
  • "; } else { var href = "
  • " + (index + 1) + "
  • "; } $("#pageUrl").append(href); } } /*璧勮*/ function zx(){ var id=$(this).data("id"); if ($("#"+id).length==0) return; $(".tabs li.selected, #dfxw2 span.selected").removeClass("selected"); $(this).addClass("selected"); $("#"+id).show().siblings().hide(); } $(".tabs li:not('.dropdown'), #dfxw2 span").bind("mouseover touchstart", zx); /*璧勮鐐瑰嚮*/ $(".r6>ul>li,#dfxw2>span").each(function(){ $(this).click(function(){ var dataId=$(this).attr("data-id"); if(dataId=='dfxw2'){ return; } window.open("/"+dataId,"_blank"); } ) }) /*鐩存挱娴獥*/ $.ajax({ url : "/upload/live/config.json?_="+Math.random(), type : "get", async: true, success : function(result) { var flayer='
    '; if(result.title.length>1) flayer='
    鐩存挱
    '+result.title+'
    '; if (result.state == 1 || result.state == 2 ) { $('body').append($(flayer)); } else{ if(new Date().getTime()2)&&($a.split("//")[1][0]=='1')){b="//db.workercn.cn/media"+$a.substr(21+$a.indexOf(":"));$(this).attr({"src":b})}});