锘?/椤电
function Tabs(tabNav, tabContent, selClass) {
var index = 0;
$("body").on("mouseover", "#" + tabNav + " li", function () {
var $this = $(this);
var index = $this.index();
$("#" + tabContent + " > div").hide();
$("#" + tabNav + " li").removeClass(selClass);
$this.addClass(selClass);
$("#" + tabContent + " > div").eq(parseInt(index)).show();
if (tabNav == "newestNav") {
if ($("#" + tabNav + " li").hasClass("sec")) {
if ($('#newestPosition .right-con .newest-pos-ul[data-index=0]').length == 0) {
$('#newestPosition .right-con').append('
');
newestBuildListHtml('newestPosition', '/Home/GetNewPositionByIndustryId?industryId=0&DistrictID=' + DistrictID, 0, 'pos', 0);
}
}
}
});
}
$(function () {
//澶撮儴婕傛诞
$(window).scroll(function () {
var $header = $("#header");
var $nav = $("#nav");
var top = $(window).scrollTop();
if (top < 30) {
$header.removeClass("header-float");
$nav.removeClass("nav-float");
} else {
$header.addClass("header-float");
$nav.addClass("nav-float");
}
});
//鑱氱劍鍥
layui.use(['carousel', 'form'], function () {
var carousel = layui.carousel
, form = layui.form;
carousel.render({
elem: '#layuiFocus'
, arrow: 'always'
, width: '600px'
, height: '262px'
, interval: 5000
});
});
if (DistrictID == 2 || DistrictID == 1) {//鏌冲窞銆佹鏋
//鎷涜仒浼
$("#sceneAnnouncement .con li").each(function () {
var $this = $(this);
if ($this.children(".name").children("a").height() < 18) {
$this.children(".name").addClass("dan");
}
});
//鏌冲窞鐜板満鎷涜仒鏍忕洰涓婁笅婊氬姩 star
var quantity = $("#lzRecruiting").children("li").length;
if (quantity > 3) {
setInterval(function () {
$('#lzRecruiting').animate({
marginTop: "-47px"
}, 1000, function () {
$(this).css({ marginTop: "0" }).find("li:first").appendTo(this);
});
}, 3000);
}
}
if (document.getElementById("layuiHengfu")) {
//妯箙骞垮憡
layui.use(['carousel', 'form'], function () {
var carousel = layui.carousel
, form = layui.form;
carousel.render({
elem: '#layuiHengfu'
, arrow: 'none'
, width: '1200px'
, height: '63px'
, interval: 3000
, anim: 'fade'
});
});
}
if (DistrictID == 1) {//妗傛灄
//妯箙骞垮憡2
layui.use(['carousel', 'form'], function () {
var carousel = layui.carousel
, form = layui.form;
carousel.render({
elem: '#layuiGLHengfu'
, arrow: 'hover'
, width: '913px'
, height: '175px'
, interval: 3000
, anim: 'fade'
});
});
}
//鍥剧墖寤惰繜鍔犺浇
$("img.lazy").lazyload({
threshold: 100,
effect: "fadeIn"
});
getDataInitList("recommendEnterprise", RECOMMEND_ENTS_PAGER, '/home/_RecommendCompanyPart?dataType=json&DistrictID=' + DistrictID);//鎺ㄨ崘浼佷笟
getDataInitList("emergencyRecruitment", EMERGENCY_PAGER, '/home/_EmergencyPositionPart?getdata=emergency&DistrictID=' + DistrictID);//鎬ヨ仒鑱屼綅
getDataInitList("highSalaryRecruitment", HIGH_SALARY_PAGER, '/home/_EmergencyPositionPart?getdata=high&DistrictID=' + DistrictID);//楂樿柂鑱屼綅
if (DistrictID == 18 || DistrictID == 20 ) {//璐哄窞銆佸钩鍗
getDataInitList("DS_NewestEnt", RECOMMEND_ENTS_PAGER, '/home/_DsNewCompanyPart?districtId=' + DistrictID);//鏈€鏂颁紒涓
getDataInitList("DS_NewestPosition", 39, '/home/_DsNewPositionPart?districtId=' + DistrictID);//鏈€鏂拌亴浣
} else {
newest('newestEnt', '/Home/GetNewEnterpriseByIndustryId?DistrictID=' + DistrictID + '&industryId=');//鏈€鏂颁紒涓
newest('newestPosition', '/Home/GetNewPositionByIndustryId?DistrictID=' + DistrictID + '&industryId=');//鏈€鏂拌亴浣
}
//鍩庡競寮瑰嚭妗
$('#city').mouseenter(function () {
var $this = $(this);
var $con = $this.children('.con');
$con.removeClass('none');
}).mouseleave(function () {
var $this = $(this);
var $con = $this.children('.con');
$con.addClass('none');
});
Tabs("loginNav", "noLoginContent", "selected");
Tabs("newsNav", "NewsAreaContent", "selected");
Tabs("emergencyNav", "emergencyContent", "selected");
Tabs("newestNav", "newestContent", "selected");
//鑱屼綅鍒楄〃寮瑰嚭妗
$("#importantRecruitment li img,#brandRecruitment li img,#hotRecruitment li img,#recommendEnterprise li,#newestEnt_0 a,#DS_NewestEnt li").mouseenter(function () {
var $this = $(this);
var entInfo = $this.attr("data-info");
if (entInfo) {
showPosition($this, eval("(" + entInfo + ")"));
} else {
logoNoPositionListBox($this);
}
});
$("#importantRecruitment li,#brandRecruitment li,#hotRecruitment li").mouseenter(function () {
var $this = $(this);
var $img = $this.children().children('img');
showLogoMask($img);
}).mouseleave(function () {
var $this = $(this);
var $img = $this.children().children('img');
hideLogoMask($img);
});
//鎬ヨ仒寮瑰嚭妗嗭紙绗竴灞忥級
$("#emergencyRecruitment .pos-state-ent-ul li a.pos-name,#DS_NewestPosition .pos-state-ent-ul li a.pos-name").mouseover(function () {
showPositionInfo($(this));
});
//鑱屼綅琛屼笟瀵艰埅
$("#posTypeLevel1 li").mouseenter(function () {
var $this = $(this);
var id = parseInt($this.attr("id").substr(17, 4));
$("#posTypeLevel1 li").removeClass("hover");
$this.addClass("hover");
showPosTypeLevel2(id);
});
highSalaryNoBorder();
loginInfo();
});
//鐧诲綍鐩稿叧淇℃伅
function loginInfo() {
$.ajax({
type: "POST",
url: "/UserService/LoginInfo?GetData=true",
dataType: "JSON",
success: function (data) {
$("#Login_No").hide();
$("#login_jobseekerInfo").hide();
$("#login_enterpriseInfo").hide();
if (data.IsLogin) {
if (data.UserType == 0) {
//鏄剧ず浼佷笟鐩稿叧淇℃伅
$("#login_enterpriseInfo").show();
$("#pe1").html(data.NowResumeCount);
$("#pe2").html(data.PositionHisCount);
$("#pe3").html(data.PositionCount);
} else {
$("#login_jobseekerInfo").show();
$("#pj1").html(data.LookeMeCount);
$("#pj2").html(data.MsgCount);
$("#pj3").html(data.InvitationCount);
}
}
else { $("#Login_No").show(); }
}
});
}
//end 鐧诲綍鐩稿叧淇℃伅
//褰撴í骞呬负绌烘椂闅愯棌div
var hasHengfu = $("#hengfugg").children().length;
var hasHengfuchil = $("#glHengfugg .gg").children().length;
if (hasHengfu == 0) {
$("#hengfugg").hide();
}
if (hasHengfuchil == 0) {
$("#glHengfugg").hide();
}