You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

document.elementFromPoint という便利な関数を知ったので、今作っている Chrome 用 Migemo ページ内検索で使ってみた。 これが困ったことに、ブラウザごとにかなり挙動が違うのだけど、本来の動作はこんな感じらしい。 待望の document.elementFromPoint が Firefox 3.0a8pre にて実装された。仕様は nsIDOMNSDocument.idl に詳しく書いてあるが、おおよそ以下の通りである。 HTML, XUL どちらの document に対しても使用可能 document の左上を (0, 0) とし、位置 (x, y) にある実際に見えている要素を取得する 同一の document 内に存在する要素のみ取得可能。例えばインナーフレーム内の document 内に存在する要素は取得できず、代わりに iframe 要素を返
七章第二回 ノードどうしの位置関係を知るこのページの最終更新日:2018年7月29日 今回はcompareDocumentPositionというメソッドを紹介します。これはノードが持つメソッドで、題にある通り、ノードどうしの位置関係を知るというものです。いきなりサンプルを見てみましょう。 <!doctype html> <html> <head> <title>test</title> </head> <body> <p id="p1">p1</p> <p id="p2">p2</p> <script type="text/javascript"> var p1 = document.getElementById('p1'); var p2 = document.getElementById('p2'); console.log(p1.compareDocumentPosition(p2)
目次 概要 XHTMLString XHTMLStringを元に生成したdocument 各メソッドの対応ブラウザ DOMHTMLImplementation.createHTMLDocument(title) DOMImplementation.createDocument(namespaceURI, qualifiedName, doctype) DOMImplementationLS.createLSParser(mode, schemaType) DOMParser() ActiveXObject("htmlfile") 備考 独り言 参考URL 概要 [object HTMLDocument], [object Document] を生成するメソッドのまとめです。 JavaScriptコードの説明はしてませんが、document.implementation.createHTML
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く