// JavaScript Document /*=========================================================================== 以下代码由乐清市亿新科技 IME 开发 http://www.eshion.cn Tel:0577-27802780 ===========================================================================*/ try{document.execCommand("BackgroundImageCache",false,true);}catch(e){} if(navigator.userAgent.indexOf("MSIE")>0){ if(navigator.userAgent.indexOf("MSIE 6.0")>0){ alert('Please use the above version of IE6 browser to access this site!\n不支持IE6浏览器,请升级您的浏览器!'); } } //跳转页面 function gotoPage(n,query){ var page=document.getElementsByName("page")[n].value; if(page!=null && page!=""){ location.href="?page="+page+query; }else{ alert("请输入正确的页码!"); } } //回车提交=========================================================== function turn_page(path,rQuery,obj) { if(obj.value==''){alert('请输入正确的页码!');return null;} if(window.event.keyCode==13) { window.event.keyCode = 9; location.href=path+"?page="+obj.value+rQuery; } } //得到页面是哪一页(结合PHP输出页码函数)================================== function DeterminePage(page){ var pagenum=document.getElementById("pagenum").getElementsByTagName("a"); for(var i=0;ih){ objImg.style.marginTop=parseInt(parseInt(maxHeight-parseInt(h))/2)+"px"; } } } //========================================================================= //Jquery.Ajax提交表单所有项数据=============================================== function jAjaxSubmit(){ //先更改提交按钮的状态 $("#button").css("display","none"); $("#dostate").css("display","inline-block"); //Ajax $.ajax({ type:"POST", dataType:"html", url:$("#form1").attr("action"), data:$('#form1').serialize(), success:function(data){ if(data.split("#")[0]=="ok"){//已输出成功标志 location.href=data.split("#")[1]; }else{//程序出错 $("#dostate").css("display","none"); $("#button").css("display","inline-block"); alert("Run-time Error:\n------------------------------------------\n"+data); } },error:function(XMLHttpRequest,textStatus,errorThrown){//其它非200状态 $("#dostate").css("display","none"); $("#button").css("display","inline-block"); alert("Error:\n------------------------------------------\n"+XMLHttpRequest.status); } }); } //========================================================================= //新闻焦点图显示脚本========================================================== function news_focus(htmlid,borderColor,backgroundColor){ var imgsA=document.getElementById(htmlid+"_imgs_list").getElementsByTagName("a"); var thistab=0;//自动移动控制 var moveVal=90; var dostat=true; for(var i=0;i5){ dostat=false; if(thistab<=2){$("#"+htmlid+"_imgs_list").stop().animate({marginLeft:"0px"},600,'easeInOutExpo',function(){dostat=true;});} else if(thistab>=imgsA.length-3){$("#"+htmlid+"_imgs_list").stop().animate({marginLeft:-((imgsA.length-5)*moveVal)+"px"},600,'easeInOutExpo',function(){dostat=true;});} else{$("#"+htmlid+"_imgs_list").stop().animate({marginLeft:-(thistab-2)*moveVal+"px"},600,'easeOutExpo',function(){dostat=true;});} } } } //左右按钮控制 $("#"+htmlid+"_list_r").bind("click",function(){ if(dostat==false)return null; if(imgsA.length<=5)return null; var place=-(imgsA.length-5)*moveVal; if(parseInt($('#'+htmlid+'_imgs_list').css('marginLeft'))<=place)return null; dostat=false; $("#"+htmlid+"_imgs_list").animate({marginLeft:(parseInt($('#'+htmlid+'_imgs_list').css('marginLeft'))-moveVal)+"px"},600,'easeOutExpo',function(){dostat=true;}); }); $("#"+htmlid+"_list_l").bind("click",function(){ if(dostat==false)return null; if(parseInt($('#'+htmlid+'_imgs_list').css('marginLeft'))>=0)return null; dostat=false; $("#"+htmlid+"_imgs_list").animate({marginLeft:(parseInt($('#'+htmlid+'_imgs_list').css('marginLeft'))+moveVal)+"px"},600,'easeOutExpo',function(){dostat=true;}); }); //左右按钮颜色变化 $("#"+htmlid+"_list_r").bind("mouseover",function(){$(this).css("background-color","#999");}); $("#"+htmlid+"_list_r").bind("mouseout",function(){$(this).css("background-color","#DDD");}); $("#"+htmlid+"_list_l").bind("mouseover",function(){$(this).css("background-color","#999");}); $("#"+htmlid+"_list_l").bind("mouseout",function(){$(this).css("background-color","#DDD");}); //默认第一个显示 if(imgsA[0]!=null){ if(document.all){//IE setTimeout(function(){imgsA[0].click();},100); }else{//修复FF下pic的click事件 var evt = document.createEvent("MouseEvents"); evt.initEvent("click",true,true); setTimeout(function(){imgsA[0].dispatchEvent(evt);},100); } } } //========================================================================== //产品焦点图显示脚本========================================================== function pro_focus(htmlid,borderColor,backgroundColor,zoom){ var imgsA=document.getElementById(htmlid+"_focus_imgs_list").getElementsByTagName("a"); var thistab=0;//自动移动控制 var moveVal=66; var dostat=true; for(var i=0;i4){ dostat=false; if(thistab<=1){$("#"+htmlid+"_focus_imgs_list").stop().animate({marginLeft:"0px"},600,'easeOutBack',function(){dostat=true;});} else if(thistab>=imgsA.length-3){$("#"+htmlid+"_focus_imgs_list").stop().animate({marginLeft:-((imgsA.length-4)*moveVal)+"px"},600,'easeOutBack',function(){dostat=true;});} else{$("#"+htmlid+"_focus_imgs_list").stop().animate({marginLeft:-(thistab-1)*moveVal+"px"},600,'easeOutBack',function(){dostat=true;});} } } } //放大镜图标 if(zoom==1 || zoom==true){ $("#"+htmlid+"_img").bind("mouseover",function(){ $("#"+htmlid+"_zoomer").css("display","none"); }); $("#"+htmlid+"_img").bind("mouseout",function(){ $("#"+htmlid+"_zoomer").css("display","block"); }); } //左右按钮控制 $("#"+htmlid+"_img_list_r").bind("click",function(){ if(dostat==false)return null; if(imgsA.length<=4)return null; var place=-(imgsA.length-4)*moveVal; if(parseInt($('#'+htmlid+'_focus_imgs_list').css('marginLeft'))<=place)return null; dostat=false; $("#"+htmlid+"_focus_imgs_list").animate({marginLeft:(parseInt($('#'+htmlid+'_focus_imgs_list').css('marginLeft'))-moveVal)+"px"},600,'easeOutBack',function(){dostat=true;}); }); $("#"+htmlid+"_img_list_l").bind("click",function(){ if(dostat==false)return null; if(parseInt($('#'+htmlid+'_focus_imgs_list').css('marginLeft'))>=0)return null; dostat=false; $("#"+htmlid+"_focus_imgs_list").animate({marginLeft:(parseInt($('#'+htmlid+'_focus_imgs_list').css('marginLeft'))+moveVal)+"px"},600,'easeOutBack',function(){dostat=true;}); }); //左右按钮颜色变化 $("#"+htmlid+"_img_list_r").bind("mouseover",function(){$(this).css("border-color","#CCC");}); $("#"+htmlid+"_img_list_r").bind("mouseout",function(){$(this).css("border-color","#DDD");}); $("#"+htmlid+"_img_list_l").bind("mouseover",function(){$(this).css("border-color","#CCC");}); $("#"+htmlid+"_img_list_l").bind("mouseout",function(){$(this).css("border-color","#DDD");}); //默认第一个显示 if(imgsA[0]!=null){ if(document.all){//IE setTimeout(function(){imgsA[0].click();},1000); }else{//修复FF下pic的click事件 var evt = document.createEvent("MouseEvents"); evt.initEvent("click",true,true); setTimeout(function(){imgsA[0].dispatchEvent(evt);},1000); } } //屏蔽右键 $("#"+htmlid+"_img,#"+htmlid+"_focus_imgs_list").bind('click',function(){return false;}); $("#"+htmlid+"_img,#"+htmlid+"_focus_imgs_list").bind('contextmenu',function(){return false;}); } //========================================================================== //产品焦点图显示脚本(带水印)===================================================== function pro_focus_mark(htmlid,borderColor,backgroundColor,zoom){ var zoomer=document.getElementById(htmlid+"_zoomer");//右下角放大镜图标 var imgsA=document.getElementById(htmlid+"_focus_imgs_list").getElementsByTagName("a"); var thistab=0;//自动移动控制 var moveVal=66; var dostat=true; for(var i=0;i4){ dostat=false; if(thistab<=1){$("#"+htmlid+"_focus_imgs_list").stop().animate({marginLeft:"0px"},600,'easeOutBack',function(){dostat=true;});} else if(thistab>=imgsA.length-3){$("#"+htmlid+"_focus_imgs_list").stop().animate({marginLeft:-((imgsA.length-4)*moveVal)+"px"},600,'easeOutBack',function(){dostat=true;});} else{$("#"+htmlid+"_focus_imgs_list").stop().animate({marginLeft:-(thistab-1)*moveVal+"px"},600,'easeOutBack',function(){dostat=true;});} } } } //放大镜图标 if(zoom==1 || zoom==true){ $("#"+htmlid+"_img").bind("mouseover",function(){ $("#"+htmlid+"_zoomer").css("display","none"); }); $("#"+htmlid+"_img").bind("mouseout",function(){ $("#"+htmlid+"_zoomer").css("display","block"); }); } //左右按钮控制 $("#"+htmlid+"_img_list_r").bind("click",function(){ if(dostat==false)return null; if(imgsA.length<=4)return null; var place=-(imgsA.length-4)*moveVal; if(parseInt($('#'+htmlid+'_focus_imgs_list').css('marginLeft'))<=place)return null; dostat=false; $("#"+htmlid+"_focus_imgs_list").animate({marginLeft:(parseInt($('#'+htmlid+'_focus_imgs_list').css('marginLeft'))-moveVal)+"px"},600,'easeOutBack',function(){dostat=true;}); }); $("#"+htmlid+"_img_list_l").bind("click",function(){ if(dostat==false)return null; if(parseInt($('#'+htmlid+'_focus_imgs_list').css('marginLeft'))>=0)return null; dostat=false; $("#"+htmlid+"_focus_imgs_list").animate({marginLeft:(parseInt($('#'+htmlid+'_focus_imgs_list').css('marginLeft'))+moveVal)+"px"},600,'easeOutBack',function(){dostat=true;}); }); //左右按钮颜色变化 $("#"+htmlid+"_img_list_r").bind("mouseover",function(){$(this).css("border-color","#CCC");}); $("#"+htmlid+"_img_list_r").bind("mouseout",function(){$(this).css("border-color","#DDD");}); $("#"+htmlid+"_img_list_l").bind("mouseover",function(){$(this).css("border-color","#CCC");}); $("#"+htmlid+"_img_list_l").bind("mouseout",function(){$(this).css("border-color","#DDD");}); //默认第一个显示 if(imgsA[0]!=null){ if(document.all){//IE setTimeout(function(){imgsA[0].click();},1000); }else{//修复FF下pic的click事件 var evt = document.createEvent("MouseEvents"); evt.initEvent("click",true,true); setTimeout(function(){imgsA[0].dispatchEvent(evt);},1000); } if(zoomer!=null)zoomer.style.display="none"; if(zoomer!=null)zoomer.style.display="block"; } //屏蔽右键 $("#"+htmlid+"_img,#"+htmlid+"_focus_imgs_list").bind('click',function(){return false;}); $("#"+htmlid+"_img,#"+htmlid+"_focus_imgs_list").bind('contextmenu',function(){return false;}); } //========================================================================== //加入收藏夹代码============================================================== /* function fav(tit,url){ var ctrl = (navigator.userAgent.toLowerCase()).indexOf('mac') != -1 ? 'Command/Cmd': 'CTRL'; if (document.all) { window.external.addFavorite(url, tit); }else if(window.sidebar){ window.sidebar.addPanel(tit,url,""); }else{ alert('You can try the shortcut key '+ ctrl +' + D added to favorites!'); } } */ //加入收藏 function fav(sURL,sTitle){ sURL=encodeURI(sURL); try{ window.external.addFavorite(sURL,sTitle); }catch(e) { try{ window.sidebar.addPanel(sTitle,sURL,""); }catch (e) { alert("You can try the shortcut key '+ ctrl +' + D added to favorites!"); } } } //========================================================================== //标签组默认显示操作=========================================================== function tags_show(id){ var tags_title=document.getElementById(id+"_title").getElementsByTagName("a"); for(var i=0;i0){ tags_title[0].className="A"; document.getElementById("tag_content_0").style.display="block"; } } //========================================================================== //递归显示左侧菜单效果========================================================= function main_list_all(htmlclass){ //获取地址栏参数 var mpid=GetQueryString("mpid"); var id=GetQueryString("id"); if(!isNaN(mpid) && mpid!=null){ //当前级高亮 var thislev=$('.prolist_side a[datavalue='+mpid+']'); thislev.addClass("A"); //下一级打开 thislev.next().removeClass("close"); thislev.next().addClass("open"); //加号变减号 thislev.prev().removeClass("close"); thislev.prev().addClass("open"); //向上追溯 upToup(thislev,htmlclass); } if(!isNaN(id) && id!=null){ //当前级高亮 var thispro=$('.prolist_side_son a[datavalue='+id+']'); thispro.addClass("A"); } var prolist_side=$("."+htmlclass); var time; //默认加减号鼠标触发 prolist_side.find("span").bind("mouseover",function(){ if($(this).attr("class")=="open"){ $(this).css("background-position","right -283px"); }else{ $(this).css("background-position","right -83px"); } }); prolist_side.find("span").bind("mouseout",function(){ if($(this).attr("class")=="open"){ $(this).css("background-position","right -183px"); }else{ $(this).css("background-position","right 9px"); } }); //点击变化 prolist_side.find("span").bind("click",function(){ var ul=$(this).next().next(); var alpha=true; if($.browser.msie){ alpha=false; } if(ul.css("display")=="none"){ //将加号变为减号 $(this).css("background-position","right -283px"); $(this).attr("class","open"); (ul.height()<140)?time=100:time=ul.height(); if(alpha)(ul.children()).hide().fadeIn(time); ul.slideDown(time); }else{ //将减号变为加号 $(this).css("background-position","right -83px"); $(this).attr("class","close"); ((ul.height()-100)<100)?time=100:time=ul.height()-100; if(alpha)(ul.children()).fadeOut(time); ul.slideUp(time); } }); } //向上递归追溯 function upToup(obj,htmlclass){ if(obj.parent().parent().attr("class")==null)return null; if(obj.parent().parent().attr("class").indexOf(htmlclass)==-1) return null; obj.parent().parent().prev().addClass("A");//高亮 obj.parent().parent().prev().next().removeClass("close");//关闭 obj.parent().parent().prev().next().addClass("open");//打开 //加号变减号 obj.parent().parent().prev().prev().removeClass("close"); obj.parent().parent().prev().prev().addClass("open"); upToup(obj.parent().parent().prev(),htmlclass); } //=========================================================================== //获取地址栏参数============================================================== function GetQueryString(name){ var reg=new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r=window.location.search.substr(1).match(reg); if(r!=null)return unescape(r[2]); return null; } //=========================================================================== var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = " https://hm.baidu.com/hm.js?2e752ed9d37eed7b35aa7e4d774a71f1"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();