|
||||
|
||||
offset(coordinates)
version 1.4 以降
解説
マッチした最初の要素の、ドキュメントの左上からの相対位置を設定します。 引数
戻り値
関連例
例1:移動ボタンをクリックすると、10 ピクセルづつ移動します。 var count = 0; var direction = 1; $("#run").click(function() { direction = count == 10 ? -1 : count == 0 ? 1 : direction; count = count + direction; var os = $(".box").offset(); $(".box").offset({ top: os.top + direction*10, left: os.left + direction*10 }); }); |
|
|||
© 2007-2011 by いけまさ. All rights Reserved. |