■属性自体を削除する
.removeAttr(“hoge”)
■class=”fuga”を持っていない要素を絞り込み
$(“hoge”).not(“.fuga”)
■現在のスクロール位置(縦)を確認
$(window).scrollTop()
■サブミット時
.submit(どうするこうする)
■要素の高さを取りたい時
.outerHeight( [ includeMargin ] )
The top and bottom padding and border are always included in the .outerHeight() calculation; if the includeMargin argument is set to true, the margin (top and bottom) is also included.
http://api.jquery.com/outerHeight/
・Chrome Safariで高さがきちんと取れない時
画像レンダリング前の高さになっている可能性アリ
$(document).ready(function()
を
$(window).load(function()
に変更する
http://productforums.google.com/forum/#!topic/chrome/V-Qd5B6GSLA
http://stackoverflow.com/questions/2501273/cant-get-true-height-width-of-object-in-chrome
ちなみに$(document).readyと$(window).loadの違いについて
http://webcraft.seesaa.net/article/169973277.html
開始時間の差を計測する(デバッグにつかえそう)
http://jsdo.it/kanonji/sbCI
■何番目の要素か取りたい時
$(ul#navi li).index(this)
$(セレクタ).index(セレクタの中のどれ?)というような指定になる。今回は、「リストの中のクリックしたもの」を表示させる。
ちなみに「index + 1」としているのは、要素の開始が0番目からなので、わかりやすいようにプラス1をしている。
http://h2ham.seesaa.net/article/118961430.html
全くもって覚えてないからremoveAttrをもっかい検索していた。[2017.06.23 add]
■後から動的に追加したインラインstyleを全て削除
jQueryで追加したstyle属性を全て削除する方法 – FEVDES BLOGFEVDES BLOG
コメントを残す