購買2CD專輯,即贈精美書籤(限量商品送完為止)
descSectionTop) {
desc_sections.find("ul").css({"top": 0});
if (currentScrollPos > prevScrollPos && product_window.scrollTop() > descSectionTop + headerHeight) {
desc_sections
.stop()
.addClass("desc_sections_hold")
.css({"min-height": descSectionHeight})
.find("ul")
.css({"top": 0});
} else if (prevScrollPos > currentScrollPos) {
desc_sections
.stop()
.addClass("desc_sections_hold")
.css({"min-height": descSectionHeight})
.find("ul")
.css({"top": headerHeight});
} else {
prevScrollPos = 0;
} prevScrollPos = currentScrollPos;
if ($(window).width() < 768) {
$("body").css("padding-bottom", "68px");
}
} else {
prevScrollPos = 0;
desc_sections.stop().removeClass("desc_sections_hold")
if ($(window).width() < 768) {
$("body").css("padding-bottom", "68px");
}
}
// 點選產品說明滑動
$(".desc_sections a.scroll").bind("click", function(event) {
var targetScrollTop = parseInt($($(this).attr("href")).offset().top - descSectionHeight + 1);
if (targetScrollTop > window.scrollY + 1) {
$("html, body").stop().animate({
scrollTop: targetScrollTop
}, 300);
} else {
$("html, body").stop().animate({
scrollTop: targetScrollTop - headerHeight
}, 300);
}
});
// 顯示當前產品說明
if (currentScrollPos > prevScrollInformationPos) {
$.each(desc_section_list, function(index, desc_section) {
var desc_sectionTop = $(desc_section).offset().top - descSectionHeight - 1
var desc_sectionHeight = $(desc_section).height()
var current_desc_section = $("a.scroll[href$='" + $(desc_section).attr("id") + "']");
if (product_window.scrollTop() > desc_sectionTop || index === 0) {
current_desc_section
.stop()
.addClass('active')
.parent()
.siblings()
.find("a")
.removeClass('active');
} else {
current_desc_section.removeClass('active');
} prevScrollInformationPos = currentScrollPos;
});
} else {
$.each(desc_section_list, function(index, desc_section) {
var desc_sectionTop = $(desc_section).offset().top - descSectionHeight - 1
var desc_sectionHeight = $(desc_section).height()
var current_desc_section = $("a.scroll[href$='" + $(desc_section).attr("id") + "']");
if (product_window.scrollTop() + headerHeight > desc_sectionTop) {
current_desc_section
.stop()
.addClass('active')
.parent()
.siblings()
.find("a")
.removeClass('active');
} else {
current_desc_section.removeClass('active');
}
});
prevScrollInformationPos = currentScrollPos;
}
});
})