在元素本身中设置jQuery UI属性
尽管如此,我的问题可能微不足道: 要将手风琴设置为适合其内容,请执行以下操作: 我可以在元素本身中执行此操作吗?这就是我想做的:在元素本身中设置jQuery UI属性,jquery,jquery-ui,Jquery,Jquery Ui,尽管如此,我的问题可能微不足道: 要将手风琴设置为适合其内容,请执行以下操作: 我可以在元素本身中执行此操作吗?这就是我想做的: <div id="accordion" style="heightStyle: 'content';" > 否。这不是样式元素,而是jQuery参数。该参数允许jQuery accordian库以某种方式运行 这只是一些只需更改值即可执行的代码: if (heightStyle === "fill") { maxHeight = parent.h
<div id="accordion" style="heightStyle: 'content';" >
否。这不是样式元素,而是jQuery参数。该参数允许
jQuery accordian
库以某种方式运行
这只是一些只需更改值即可执行的代码:
if (heightStyle === "fill") {
maxHeight = parent.height();
this.element.siblings(":visible").each(function () {
var elem = $(this),
position = elem.css("position");
if (position === "absolute" || position === "fixed") {
return;
}
maxHeight -= elem.outerHeight(true);
});
this.headers.each(function () {
maxHeight -= $(this).outerHeight(true);
});
this.headers.next()
.each(function () {
$(this).height(Math.max(0, maxHeight -
$(this).innerHeight() + $(this).height()));
})
.css("overflow", "auto");
} else if (heightStyle === "auto") {
maxHeight = 0;
this.headers.next()
.each(function () {
maxHeight = Math.max(maxHeight, $(this).css("height", "").height());
})
.height(maxHeight);
}
不。这不是样式元素,而是jQuery参数。该参数允许
jQuery accordian
库以某种方式运行
这只是一些只需更改值即可执行的代码:
if (heightStyle === "fill") {
maxHeight = parent.height();
this.element.siblings(":visible").each(function () {
var elem = $(this),
position = elem.css("position");
if (position === "absolute" || position === "fixed") {
return;
}
maxHeight -= elem.outerHeight(true);
});
this.headers.each(function () {
maxHeight -= $(this).outerHeight(true);
});
this.headers.next()
.each(function () {
$(this).height(Math.max(0, maxHeight -
$(this).innerHeight() + $(this).height()));
})
.css("overflow", "auto");
} else if (heightStyle === "auto") {
maxHeight = 0;
this.headers.next()
.each(function () {
maxHeight = Math.max(maxHeight, $(this).css("height", "").height());
})
.height(maxHeight);
}
style=”“
=CSS,style=“heightStyle:'content';”
!=凯西,我知道这个事实。我想知道,是否还有其他属性。哪一个?没有,对不起,你可以试试身高:100%代码>(CSS)太糟糕了。想象一个数据预设=“heightStyle:content;”或类似的元素属性。如果你潜入到手风琴代码中,你可能能够扩展它!这是完全可能的!(使用您建议的数据属性):style=“
=CSS,style=“heightStyle:”content“;”
!=凯西,我知道这个事实。我想知道,是否还有其他属性。哪一个?没有,对不起,你可以试试身高:100%代码>(CSS)太糟糕了。想象一个数据预设=“heightStyle:content;”或类似的元素属性。如果你潜入到手风琴代码中,你可能能够扩展它!这是完全可能的!(使用您建议的数据属性):)不行?我真的需要注入一些JS吗?你试过不输入任何东西吗<代码>内容似乎是默认值。嗯,不。就我看来,“填充”是默认值。至少我的手风琴把内容填满了相同的高度。不行吗?我真的需要注入一些JS吗?你试过不输入任何东西吗<代码>内容似乎是默认值。嗯,不。就我看来,“填充”是默认值。至少我的手风琴将内容填充到了相同的高度。