Setting jQuery UI attribute in element itself -
well, question might trivial, nevertheless:
to set accordion fit content, docs this:
$( ".selector" ).accordion({ heightstyle: "content" }); may in element itself? i'd do:
<div id="accordion" style="heightstyle: 'content';" >
no. not style element, jquery parameter. parameter allows jquery accordian library behave in way.
this of code executes changing value:
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); }
Comments
Post a Comment