Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私が理解している限り、jQuery は魔法の測定を行って、要素の「通常の」高さを把握し、.slideDown(). jQueryがそれらを持っているとすぐにこれらの測定値を取得する方法はありますか?
.slideDown()
具体的に私がやりたいことは、scrollTop明らかにされようとしているターゲットの一番下まで html をアニメーション化することです。
scrollTop
あなたの質問を正しく理解していれば、jquery はheightすでにこの「魔法」を処理しています。ネイティブoffsetHeightは非表示の要素に対して 0 を返しますが、jqueryheightは適切な高さを返します。
height
offsetHeight
また、魔法が気になる方もどうぞ。基本的{ position: "absolute", visibility: "hidden", display: "block" }に、要素に を設定し、高さを確認してから、元の値に戻します。
{ position: "absolute", visibility: "hidden", display: "block" }