⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 indexjs_cpd.js

📁 仿招聘网站 SSH框架 ajax功能
💻 JS
字号:
var DELAY_TIME=500;var subDivClassName="occlayer wid550";var showTimer=null;var PREFIX_CATEGORY="Cat";var PREFIX_INDUSTRY="Ind";var PREFIX_LOCATION="Loc";var URL_TARGETED_CATEGORY="/SearchResult.aspx?prj=occ&occIDList={0}";var URL_TARGETED_INDUSTRY="/SearchResult.aspx?prj=ind&indIDList={0}";var URL_TARGETED_LOCATION="/SearchResult.aspx?myLocIDList={0}";function LoadItems(divID,arrIDs,arrNames,type){var container=$(divID);if(container.childNodes.length>0)return;var url=prefix="";switch(type){case"Category":url=URL_TARGETED_CATEGORY;prefix=PREFIX_CATEGORY;break;case"Industry":url=URL_TARGETED_INDUSTRY;prefix=PREFIX_INDUSTRY;break;case"Location":url=URL_TARGETED_LOCATION;prefix=PREFIX_LOCATION;break;default:}ul=$E("ul");for(var i=0;i<arrNames.length;i++){var li=$E("li");var el=$E("a");if("Category"==type||"Location"==type){if(el.addEventListener){el.addEventListener("mouseover",loadSubItems,false);el.addEventListener("mouseout",hideSubItems,false);}else{el.onmouseover=loadSubItems;el.onmouseout=hideSubItems;}el.href="javascript:void(0);";el.style.overflow='auto';}else{el.href=url.replace('{0}',arrIDs[i]);}el.id="lnk"+prefix+arrIDs[i];el.innerHTML=arrNames[i];li.appendChild(el);ul.appendChild(li);}var clearLi=$E("li");clearLi.className="clear";ul.appendChild(clearLi);container.appendChild(ul);}function createStyleDiv(){var els=$E("div","div");if(!els)return;els[0].className="midcon";els[1].className="listblk2";els[0].appendChild(els[1]);return els[0];}function loadSubItems(e){if(showTimer){window.clearTimeout(showTimer);showTimer=null;}var subContainer=$("subItems");var e=e||window.event;var link=(e.srcElement)?e.srcElement:e.target;showTimer=window.setTimeout(loadSub,500);function loadSub(){var type,id;type=link.id.substring(3,6);id=link.id.substring(6,link.id.length);if(subContainer.hasChildNodes()){for(var i=(subContainer.childNodes.length-1);i>-1;i--){subContainer.removeChild(subContainer.childNodes[i]);}}var arrSubIDs,arrSubNames,url;if("Cat"==type){arrSubIDs=getOccIDs(id);arrSubNames=getOccNames(id);url=URL_TARGETED_CATEGORY;}else{arrSubIDs=getAreaIDs(id);arrSubNames=getAreaNames(id);url=URL_TARGETED_LOCATION;}arrSubIDs.shift();arrSubNames.shift();var halfItems=(arrSubIDs.length%2==0)?arrSubIDs.length/2:(parseInt(arrSubIDs.length/2)+1);var popupHeight=50+halfItems*23;var botRange=Geometry.getViewportHeight()-(getY(link)-Geometry.getVerticalScroll())-18;var shiftRange=(botRange<popupHeight)?(botRange-popupHeight+18):18;subContainer.style.left=getX(link)+75+"px";subContainer.style.top=(getY(link)+shiftRange)+"px";var parentName;parentName=$("lnk"+type+id).innerHTML;var subUL=$E("ul");for(var j=0;j<arrSubIDs.length;j++){var subLI=$E("li");var subLink=$E("a");subLink.href=url.replace("{0}",arrSubIDs[j]);subLink.innerHTML=arrSubNames[j];subLI.appendChild(subLink);subUL.appendChild(subLI);}var clearLi=$E("li");clearLi.className="clear";subUL.appendChild(clearLi);var styleDiv=createStyleDiv();var hDiv=$E("div");var hH3=$E("h3");hDiv.className="h3blk";var parent=$E("a");parent.href=url.replace("{0}",id);parent.innerHTML=parentName;hH3.appendChild(parent);hDiv.appendChild(hH3);styleDiv.insertBefore(hDiv,styleDiv.firstChild);styleDiv.childNodes[1].appendChild(subUL);subContainer.appendChild(styleDiv);showOrHide("block");}}function hideSubItems(){if(showTimer){window.clearTimeout(showTimer);showTimer=null;}showOrHide("none");}var timer;function showOrHide(style){if(style=='none'){timer=setTimeout("$('subItems').style.display = '"+style+"'",DELAY_TIME);}else{if(timer)window.clearTimeout(timer);timer=null;$('subItems').style.display=style;}}var SWITCH_DELAY_TIME=1600;var switchTimer;function delaySwitch(type){if(switchTimer!=null){window.clearTimeout(switchTimer);switchTimer=null;}if(type=="HotJobs"){switchTimer=window.setTimeout("switchTab('tabHot', 'divTargetedHot', 'tabBox', 'divBox');",SWITCH_DELAY_TIME);}else if(type=="CodeJobs"){switchTimer=window.setTimeout("switchTab('tabCold', 'divTargetedCold', 'tabBox', 'divBox');",SWITCH_DELAY_TIME);}else if(type=="Category"){switchTimer=window.setTimeout("switchTab('tabCat', 'divTargetedCat', 'tabBox', 'divBox');LoadItems('divTargetedCat', GetOccParentIDs(), GetOccParentNames(), 'Category');",SWITCH_DELAY_TIME);}else if(type=="Industry"){switchTimer=window.setTimeout("switchTab('tabInd', 'divTargetedInd', 'tabBox', 'divBox');LoadItems('divTargetedInd', getIndustryIDs(), getIndustryNames(), 'Industry');",SWITCH_DELAY_TIME);}}function clearDelaySwitch(){if(switchTimer!=null){window.clearTimeout(switchTimer);switchTimer=null;}}function switchTab(showTab,showLayer,tabBoxID,divBoxID){var tabBox=$(tabBoxID);var divBox=$(divBoxID);for(var i=0;i<tabBox.childNodes.length;i++){var n1=tabBox.childNodes[i];if("DIV"==n1.nodeName){if(n1.id=="tabHot"||n1.id=="tabCold")n1.className=TAB_OFF_STYLE_NEW;else n1.className=TAB_OFF_STYLE;}}for(var j=0;j<divBox.childNodes.length;j++){var n2=divBox.childNodes[j];if("DIV"==n2.nodeName)n2.style.display="none";}if($(showTab).id=="tabHot"||$(showTab).id=="tabCold")$(showTab).className=TAB_ON_STYLE_NEW;else $(showTab).className=TAB_ON_STYLE;$(showLayer).style.display="";}function InitSelectList(){var occSel=$("SelParentCate");InitMainOccupation(occSel);$("SelParentCate").value=600;var areaSel=$("SelParentArea");InitMainArea(areaSel);$('spOccMax').innerHTML=cateMaxNum;$('spAreaMax').innerHTML=AreaMaxNum;$('spIndMax').innerHTML=IndMaxNum;}function CheckSearch(){LastUpdateItems();SortSearchCondition();var occIDValue=$("HidOccIDs").value;var occOrgKey='请输入职位或公司关键词';var companyOrgKey='请输入职位或公司关键词';var occKeyWord="";var companyKeyWord="";radOccCom=document.all("radSearchType")[0].checked;if(radOccCom){occKeyWord=$("txtKeywords").value;companyKeyWord="";}else{companyKeyWord=$("txtKeywords").value;occKeyWord="";}return ValidateAdvanceSearchCondition(occIDValue,occKeyWord,occOrgKey,companyKeyWord,companyOrgKey);}function ifmLoad(obj){try{if(obj.readyState=="complete"){var content=obj.document.frames["ifmTips"].document.getElementById("content").innerHTML;$("ifmTips").style.height=Math.ceil(content.trueLength()/22)*18+48+"px";$("ifmTips").style.display="";}}catch(ex){}}function IndexBottom(){InitSelectList();var type=request.QueryString('typeid');if(type=='Ind'){switchTab('tabInd','divTargetedInd','tabBox','divBox');LoadItems('divTargetedInd',getIndustryIDs(),getIndustryNames(),'Industry');}else if(type=='Cat'){switchTab('tabCat','divTargetedCat','tabBox','divBox');LoadItems("divTargetedCat",GetOccParentIDs(),GetOccParentNames(),"Category");}else if(type=='Hot'){switchTab('tabHot','divTargetedHot','tabBox','divBox');}else if(type=='Cold'){switchTab('tabCold','divTargetedCold','tabBox','divBox');}else{switchTab('tabHot','divTargetedHot','tabBox','divBox');}if(userID!=0&&showTips&&document.getElementById("ifmTips")!=null){var ifmTip=document.getElementById("ifmTips");ifmTip.src="Tips1.aspx";}}function btnSearchClick(){if(CheckSearch()){var sb=new StringBuilder();if(TrimLR($("HidIndustryIDs").value)!=""){sb.Append("&indIDList=").Append(TrimLR($("HidIndustryIDs").value));}if(TrimLR($("HidOccIDs").value)!=""){sb.Append("&occIDList=").Append(TrimLR($("HidOccIDs").value));}if(TrimLR($("HidOccParentIDs").value)!=""){sb.Append("&occParentIDList=").Append(TrimLR($("HidOccParentIDs").value));}if(TrimLR($("HidAreaIDs").value)!=""){sb.Append("&myLocIDList=").Append(TrimLR($("HidAreaIDs").value));}if(TrimLR($("HidAreaParentIDs").value)!=""){sb.Append("&myLocParentIDList=").Append(TrimLR($("HidAreaParentIDs").value));}if($("SelJobUpdateTime").value!="255"){sb.Append("&jobPostCycle=").Append($("SelJobUpdateTime").value);}var key=$("txtKeywords").value!="请输入职位或公司关键词"?$("txtKeywords").value:"";if(key!=""){if($("radJobSearch").checked){sb.Append("&positionName=").Append(UrlEncode(key));}else{sb.Append("&companyName=").Append(UrlEncode(key));}}sb.Append("&prj=quick");var u=sb.toString();u="SearchResult.aspx?"+LTrim(u,"&");if(typeof(appendRnd)!="undefined")u=appendRnd(u);window.location=u;}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -