gpt4 book ai didi

jquery - html中的数据类型

转载 作者:太空宇宙 更新时间:2023-11-04 15:31:46 24 4
gpt4 key购买 nike

你能告诉我 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();

最佳答案

看起来像自定义属性。 Inventor 希望以某种方式使用此属性注释某些 HTML 元素,以便可以引用它们(例如,通过您提供的代码)

关于jquery - html中的数据类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13295071/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com