24 lines
735 B
JavaScript
24 lines
735 B
JavaScript
(function () {
|
|
// 固定title
|
|
if ($(window).scrollTop() >= 430) {
|
|
$("#at").addClass("fixedTab")
|
|
} else {
|
|
$("#at").removeClass("fixedTab")
|
|
}
|
|
$(window).scroll(function () {
|
|
var top = $(window).scrollTop() | document.documentElement.scrollTop
|
|
if ($(window).scrollTop() >= 430) {
|
|
$("#at").addClass("fixedTab")
|
|
} else {
|
|
$("#at").removeClass("fixedTab")
|
|
}
|
|
|
|
})
|
|
// 切换
|
|
$(".atitle-cen ul li").click(function () {
|
|
var index = $(this).index()
|
|
$(".atitle-cen ul li.alitivce").removeClass("alitivce")
|
|
$(this).addClass("alitivce")
|
|
window.scrollTo(0, $(".typec").eq(index).offset().top - 100);
|
|
})
|
|
})(window) |