タグ

CSSとjQueryに関するdrumscoのブックマーク (3)

  • jQueryのposition()で相対位置を取得する

    jQueryのposition()は要素の位置を取得するメソッドですが、offset()と混同しがちですね。 offset()はドキュメントの左上を起点にしているのに対し、position()はオフセットの相対関係のある親要素を起点にしています。 絶対位置と相対位置の違いですね。 同じ要素内に別の要素を配置する場合はposition()が便利でしょう。 参考:jQueryのoffset()で表示位置の取得と要素の移動 position() の基 position()の使い方を見る前に、position()がどこを基準に位置を取得しているか見てみましょう。 position() の起点 position()は以下のように親要素の左上を起点にしています。 offset()と違って、自要素と関係のある親要素が起点となっています。

    drumsco
    drumsco 2017/08/09
    "それは親要素のcssでpositionを指定していない場合が多いようです。 cssでpositionを指定しないとデフォルトのstaticが適用され、ドキュメントの左上を起点としてしまいます。"
  • Setting Equal Heights with jQuery

    July 8, 2016 Update: The techniques described in this blog post have been deprecated in favor of the Equal Heights section on our Layout Patterns documentation. We wrote a script to “equalize” the heights of boxes within the same container and create a tidy grid — with little overhead. Creating the visual effect of equal-height columns or content boxes has been a challenge ever since we abandoned

    Setting Equal Heights with jQuery
    drumsco
    drumsco 2009/06/19
    ボックス要素の高さを揃える。
  • Project Deploy - The Future Of Robotics & Programming

    Many medical institutes in the United States use some type of software to manage their records. It eliminates the use of paper, makes transferring information easier, and provides an easy to access database. Most would assume that such a system is also very secure. But programmers and physicians from the University of California recently showed […] Everyone dreams of making their own game, and wit

  • 1