You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

180 lines
5.6 KiB

$(document).ready(function ($) {
// 导航
$(".so-bar").click(function () {
$(".search-block").stop().fadeIn();
$(".so-bar").fadeOut()
});
$(".search-top-close").click(function () {
$(".search-block").stop().fadeOut();
$(".so-bar").fadeIn()
});
$(".menuBtn").click(function () {
$(".page-hd").toggleClass("open-nav");
window.event ? window.event.cancelBubble = true : e.stopPropagation();
})
var _width = $(window).innerWidth();
$(".index-list1 li .item .online i").click(function () {
$(this).toggleClass("active");
if ($(this).text() == '收藏') {
$(this).text('已收藏')
} else {
$(this).text('收藏')
}
})
if ($(window).width() > 1280) {
$('.ul-nav li').mouseenter(function () {
$(this).find('.child').stop().slideDown(150);
})
$('.ul-nav li').mouseleave(function () {
$(this).find('.child').stop().slideUp(150);
})
}
$('.footer .ft-link .item h4').on('click', function () {
if ($(window).width() < 1199) {
$(this).siblings('.link').stop().slideToggle(150);
$(this).parents('.item').siblings('.itema').find('.link').slideUp(150);
}
})
$('.menu').on('click', function () {
$('.mobile-con').stop().slideToggle(150);
})
if (_width < 1000) {
$(".page-nav dt .arrow").attr("href", "javascript:;");
$(".fd-top-yc .left dt").click(function (e) {
$(this).toggleClass("active").siblings("dd").stop().slideToggle();
});
$(".page-nav dt").click(function (e) {
$(this).toggleClass("open").siblings("dd").stop().slideToggle();
window.event ? window.event.cancelBubble = true : e.stopPropagation();
});
$(".popup-nav-mask").click(function () {
$(".page-hd").removeClass("open-nav");
});
$(".so-bar").click(function () {
$(".search-block").hide();
$(".select-result-m").stop().fadeIn();
});
$(".result-cancle").click(function () {
$(".select-result-m").stop().fadeOut();
$(".so-bar").fadeIn()
});
}
//返回顶部
$('.totop').click(function () {
$('body,html').animate({
'scrollTop': 0
}, 500);
});
$(window).scroll(function () {
var _top = $(window).scrollTop();
if (_top < 100) {
$('.totop').stop().fadeOut(500);
} else {
$('.totop').stop().fadeIn(500);
}
if ($(".full-career")) {
$(".full-career").addClass("close")
}
});
// 选项卡 鼠标点击切换
$(".TAB_CLICK li").click(function () {
var tab = $(this).parent(".TAB_CLICK");
var con = tab.attr("id");
var on = tab.find("li").index(this);
$(this).addClass('on').siblings(tab.find("li")).removeClass('on');
$(con).eq(on).show().siblings(con).hide();
});
// 选项卡 鼠标经过切换
$(".TAB li").mousemove(function () {
var tab = $(this).parent(".TAB");
var con = tab.attr("id");
var on = tab.find("li").index(this);
$(this).addClass('hover').siblings(tab.find("li")).removeClass('hover');
$(con).eq(on).show().siblings(con).hide();
});
var clientHeight = document.body.clientHeight;
var _focusElem = null;
document.body.addEventListener("focus", function (e) {
_focusElem = e.target || e.srcElement;
}, true);
window.addEventListener("resize", function () {
if (_focusElem && document.body.clientHeight < clientHeight) {
_focusElem.scrollIntoView(true);
}
});
(function () {
// 自定义多选
$('[role=checkbox]').each(function () {
var input = $(this).find('input[type="checkbox"]');
input.each(function () {
if ($(this).attr('checked')) {
$(this).parents('label').addClass('checked');
$(this).prop("checked", true)
}
})
input.change(function () {
$(this).parents('label').toggleClass('checked');
});
})
})();
(function () {
// 自定义单选
$('[role=radio]').each(function () {
var input = $(this).find('input[type="radio"]'),
label = $(this).find('label');
input.each(function () {
if ($(this).attr('checked')) {
$(this).parents('label').addClass('checked');
$(this).prop("checked", true)
}
})
input.change(function () {
label.removeClass('checked');
$(this).parents('label').addClass('checked');
input.removeAttr('checked');
$(this).prop("checked", true)
})
})
})();
(function () {
// 自定义单选
$('[role=radio2]').each(function () {
var input = $(this).find('input[type="radio"]'),
label = $(this).find('label');
input.each(function () {
console.log(111);
if ($(this).attr('checked')) {
$(this).parents('label').addClass('checked');
$(this).prop("checked", true)
}
})
input.change(function () {
label.removeClass('checked');
$(this).parents('label').addClass('checked');
input.removeAttr('checked');
$(this).prop("checked", true)
})
})
})();
// 打开关闭弹窗
$('.myfancy').click(function () {
var _id = $(this).attr('href');
$(_id).fadeIn(150);
$('body').addClass('ovh')
});
$('.g-close').click(function() {
$(this).parents('.g-pop,.edu-pop').hide();
$('body').removeClass('ovh')
});
});