//导航banner //荣誉事件列表 $(function() { if ($("#years_box").length) { $("#years_box").jcarousellite({ btnprev: "#left_btn", btnnext: "#right_btn", auto: 400000, //图片停留时间 scroll: 1, //每次滚动覆盖的图片个数 speed: 1000, //设置速度,0是不动。其次就是数字越大 ,移动越慢。 vertical: false, //横向(true),竖向(false) visible: 5, //显示的数量 circular: false //是否循环 }); $(".years_box ul>li:first").addclass("tabactive2"); $(".years_box ul>li").unbind("mouseover").bind("mouseover", function() { $(this).siblings("li").removeclass("tabactive2").end().addclass("tabactive2"); var index = $(".years_box ul>li").index($(this)); }); } }); function eventspage(page, spanid) { $.ajax({ type: "post", datatype: "text", url: "events.aspx", data: "cmd=getry&page=" + page + "&spanid=" + spanid, success: function(msg) { $("#" + spanid).html(msg); } }); } function checksqlinjection (val) { if (val.indexof("<") > -1 || val.indexof("<") > -1 || val.indexof("/*") > -1 || val.indexof("*/") > -1 || val.indexof("'") > -1 || val.indexof("|") > -1 || val.indexof(";") > -1 || val.indexof("select") > -1 || val.indexof("insert") > -1 || val.indexof("delete") > -1 || val.indexof("update") > -1 || val.indexof("create") > -1 || val.indexof("insert") > -1 || val.indexof("drop") > -1 || val.indexof("and") > -1 || val.indexof("exec") > -1 || val.indexof("count") > -1 || val.indexof("chr") > -1 || val.indexof("mid") > -1 || val.indexof("master") > -1 || val.indexof("or") > -1 || val.indexof("truncate") > -1 || val.indexof("char") > -1 || val.indexof("declare") > -1 || val.indexof("join") > -1 || val.indexof(">") > -1 || val.indexof("\\u") > -1) { alert("请不要包含危险字符!"); return false; } return true; } function checkparamisnumber(val) { if (!val.match(/^[0-9]*$/)) { alert("请不要在地址栏中包含危险字符!"); return false; } return true; } //--------------------------------企业荣誉分页--------------------------------------- $(function(){ if ($(".honor").length) { if ($("#years_box").length) { var year = ""; $("#years_box ul").find("li").each(function(){ $(this).live('mouseover',function(){ year = $.trim($(this).html()); if ($.trim($("#span" + year).html()) == '') { $.ajax({ type: "post", url: "../ajax.do?action=getdsj", cache: false, async: false, datatype: "html", data: { "year" : year }, success: function(data) { if( data != null ){ $("#span" + year).html(data); } } }); } var cup = $("div[value='"+year+"'] .currentpage2").attr("value"); $("#span"+ year +" .pagenum").find("a").each(function(){ if( $(this).attr("id") != ("page2no" + cup)) { $(this).attr("class", ""); } else {$(this).attr("class", "on"); } }); }); }); //-------开始写分页的代码------- $(".goalink2").live("click", function(){ var year2 = $(this).attr("value"); if (year != year2) return; var index = $("div[value='"+year2+"'] .currentpage2").val(); if (isnan(index)) { alert("请输入数字!"); return; } if (index < 1 || index > $(".pagenum[value='"+year2+"'] a").length) { alert("您输入的页码范围不正确!"); return; } $(".pagenum[value='"+year2+"'] a").each(function(){ if( $(this).attr("id") != ("page2no" + index)) { $(this).attr("class", ""); } else {$(this).attr("class", "on"); } }); $("#span"+ year2 +" > div").each(function(){ if ( $(this).attr("id") != ("page" + year2 + index)) { $(this).css("display", "none"); } else { $(this).css("display", "block"); } }); $("#span"+ year2 +" > div.clear").css("display", "block"); $("#span"+ year2 +" > div.page").css("display", "block"); }); //上一页 $(".prepage2").live("click", function(){ var year2 = $(this).attr("value"); if (year != year2) return; var index = $("div[value='"+year2+"'] .currentpage2").val(); if (index - 1 > 0) { var thisindex = index-1; $("#span"+ year2 +" > div").each(function(){ if ( $(this).attr("id") != ("page" + year2 + thisindex)) { $(this).css("display", "none"); } else { $(this).css("display", "block"); } }); $("#span"+ year2 +" > div.clear").css("display", "block"); $("#span"+ year2 +" > div.page").css("display", "block"); $(".pagenum[value='"+year2+"'] a").each(function(){ if( $(this).attr("id") != ("page2no" + thisindex)) { $(this).attr("class", ""); } else {$(this).attr("class", "on"); } }); $("div[value='"+year2+"'] .currentpage2").attr("value", thisindex); } }); //下一页 $(".nextpage2").live('click', function(){ var year2 = $(this).attr("value"); if (year != year2) return; var index = $("div[value='"+year2+"'] .currentpage2").val(); if (parseint(index) + 1 <= $(".pagenum[value='"+year2+"'] a").length) { $("#span"+ year2 +" > div").each(function(){ if ( $(this).attr("id") != ("page" + year2 + (parseint(index)+1))) { $(this).css("display", "none"); } else { $(this).css("display", "block"); } }); $("#span"+ year2 +" > div.clear").css("display", "block"); $("#span"+ year2 +" > div.page").css("display", "block"); $(".pagenum[value='"+year2+"'] a").each(function(){ if( $(this).attr("id") != ("page2no" + (parseint(index)+1))) { $(this).attr("class", ""); } else {$(this).attr("class", "on"); } }); $("div[value='"+year2+"'] .currentpage2").attr("value", (parseint(index)+1)); } }); //页码 $(".pagenum a").live('click',function(){ var year2 = $(this).attr("value"); if (year != year2) return; var index = $(this).attr("id"); var no = index.substring(7); $("#span"+ year2 +" > div").each(function(){ if ( $(this).attr("id") != ("page" + year2 + no)) { $(this).css("display", "none"); } else { $(this).css("display", "block"); } }); $("#span"+ year2 +" > div.clear").css("display", "block"); $("#span"+ year2 +" > div.page").css("display", "block"); $(".pagenum[value='"+year2+"']").find("a").each(function(){ if( $(this).attr("id") != ("page2no" + no)) { $(this).attr("class", ""); } else {$(this).attr("class", "on"); } }); $("div[value='"+year2+"'] .currentpage2").attr("value", no); }); //-------分页结束-------------- $("#years_box ul").find("li").eq(0).trigger("mouseover"); } } });