你能告诉我什么data-carouselType
意思吗?
<div class="Carousel" data-carselType="magazine">
他们使用过(在 jQuery 代码中):
if ($this.attr("data-carselType") === "magazine") {
$(prevBtn).addClass("opaque");
$(nextBtn).addClass("opaque");
this.appendChild(prevBtn);
this.appendChild(nextBtn);
pagerWidth = $(prevBtn).width();
childLength = $kids.children().length;
$kids.css("left", pagerWidth + "px").children("div").addClass("grouping");
childWidth = $kids.children("div").width();
leftMagTitle = document.createElement("div");
rightMagTitle = document.createElement("div");
prevBtn.appendChild(leftMagTitle);
nextBtn.appendChild(rightMagTitle);
$kids.width(childLength * childWidth);
$kids.children(":first-child").addClass("active");
$kids.css("left", (pagerWidth - $this.find(".caroContainer").children("div").width()) + "px");
forPrependingOne = $kids.children(":eq(" + (childLength - 1) + ")").clone();
$kids.children(":eq(" + (childLength - 1) + ")").remove();
$kids.prepend(forPrependingOne);
$kids.click(function (e) {
link = $(e.target).parents(this).children("a").attr("href");
if ($(e.target).parents(this) && e.target.tagName !== "IMG" && e.target.tagName !== "INPUT" && e.target.tagName !== "A" && link !== undefined) {
e.preventDefault();
document.location = link;
}
});
lazyLoad();