文書の URI の後に #foo などの識別子(id)をつけたアンカーから、その文書内の当該箇所へジャンプできるのは周知の通り。ただ、スクロールもせずに移動するんで、閲覧者が一瞬戸惑ったりるすわけで、CSS3 では、そのターゲットとなる要素をハイライト表示させたりすることが可能な :target 疑似クラスってのが用意されている。現在、:target 疑似クラスに対応しているブラウザは、Firefox などの Gecko 系と Safari、Konqueror とか。IE や Opera は未対応。 Selectors 6.6.2. The target pseudo-class :target そんな :target 疑似クラスを利用して、文書下部に用意した脚注を動的に表示させてみるの試み。ちなみに、サンプルは未対応な IE でも再現できるように、Suckerfish :target |
CSSルールを一括で追加する JavaScript IEのStyleSheet#addRule(selector, property)は、セレクタごとに実行しなくてはいけないため代替を書きました。 Firefox、IE 6.0、Operaで確認しました。 function addRules(css){ document.body.appendChild( document.createElement('span') ).innerHTML = '<span style="display:none">DUMMY</span><style tyoe="text/css">' + css + '</style>'; } ダミーのエレメントがないと、IEではエレメントの追加を検知しないようです。 参考リンク 暴満館 » JavaScriptでCSSを弄る際のメモ The styleSheet o
IE における "expression" の過剰検出による XSS の 誘因 2006-08-31-1: [Security] http://archive.openmya.devnull.jp/2006.08/msg00369.html IE では expression(式) をスタイルシート内で記述することで JavaScript を記述することができるのは有名ですが, IE による expression の検出がやたら過剰で XSS を引き起こしやすいということらしい. 実態参照やコメントの挿入,Unicode 文字,全角文字で記述しても expression として検出される. 詳細は,上記サイトより引用. IE では、以下のようなスタイルを記述することで、JavaScript を動作させる ことが可能です。 1) <style>ブロック内での定義 <style>input { l
またFirefoxは短縮形で取得しようとすると、設定していないプロパティにデフォルト値が入った状態で返ってくるので注意する。 getStyleValue( "div.hoge", "background" ) //Mozilla : rgb(17, 34, 51) none repeat scroll 0% 0% ルールを削除する function deleteRule( index, sheetindex ) { if( sheetindex == undefined ) sheetindex = 0; document.styleSheets[ sheetindex ].deleteRule( index ); } 全てのルールにはインデックスが振られており、それを指定することでルールから消すことができる。 ただ、同じセレクタで上書きするのとほとんど変わらないので、あまり必要にならない
JavaScriptリンク要素のアドレスなどをユーザーが訪れたことがあるか否かをJavaScriptから知る方法を以前調べたがわからなかった。多分、プライバシーの問題の絡みで存在しないのだと勝手に合点した。今日、CSS(display:none) + 擬似セレクタ(:hover) + 要素の高さ(offsetHeight) の組み合わせを思いつき書いた。 function isVisited(link){ if(!isVisited.initialized){ isVisited.initialized = true; addRule("#check_visited:visited", "display:none"); } var a = document.createElement("a"); a.href = link; a.id = "check_visited"; documen
Clever technique to help you on CSS hacks. Last updated: November 02, 2010 (v0.4.0) CSS Browser Selector is a very small javascript with just one line which empower CSS selectors. It gives you the ability to write specific CSS code for each operating system and each browser. EXAMPLE The JavaScript support is disabled on your browser. Please, enable JavaScript and refresh this page. The color of th
The article on Nifty Corners catched a lot of interest that we didn't expect at all. So, a big Thank you goes to the international webdesign community and in particular Roger Johansson from 456bereastreet.com and Nate Stainer from web-graphics.com that originally launched the link through the blogosphere. Since its publication, I've worked a lot on Nifty Corners, bringing many improvements: looki
Over the past 6 months or so Javascript has really gotten a lot of attention. I can’t name a web application released in the previous months (although I’m sure there are a few) that doesn’t use Javascript to provide an enhanced experience for users. I wanted a way to facilitate that interaction that doesn’t involve me repeating myself over and over wiring and rewiring event ovservers to a document
- March, 28th, 2017: DHTML Chess for WordPress. DHTML Chess is now available as a WordPress plugin in a free and PRO version. Learn more. - January, 16th, 2017: LudoJS Progress Bar. Samples of progress bars in the LudoJS Javascript framework on my site ludojs.com. - January, 13th, 2017: DHTML Chess 3.0. The new DHTML Chess 3 has been ported to jQuery. New demos are also available. The home of DHTM
Photos © Kevin C. Smith This is a rewrite of a very old experiment. This rewrite uses unobtrusive DOM scripting and semantic markup to achieve its goals, and is somewhat less abusive of the CPU in Firefox. It also works in Safari - the original version was written prior to Safari supporting the CSS3 "opacity" property. Opera doesn't support opacity, so the images will just flip in that browser. Fo
A premium domain name exclusively for sale on the BrandBucket network. Dynamic Drive: A vibrant, forceful name that conveys motion and innovation, suggesting cutting-edge technology and forward-thinking solutions. Possible uses: A mobile app for car diagnostics. A tech platform for logistics. An adaptive learning software. Full ownership of domain dynamicdrive.com. Logo design source files and rig
What is jQuery? jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.
Internet Explorer Team Blog We've moved! Find us at the new Microsoft Edge Dev Blog As we announced last week, with the reveal of Microsoft Edge we are archiving the IEBlog. Future... Date: 05/08/2015 Microsoft Edge is the browser for Windows 10 This morning, Joe Belfiore took to the stage at Build 2015 to share more about the next chapter in... Date: 04/29/2015 Announcing improvements to Enterpri
Looking for information about Informa TechTarget products and services? The commercial homepage has moved. Visit Informa TechTarget News 01 Aug 2025 / Policy & regulation Trump urges top drugmakers to cut U.S. prescription drug costs Trump increases pressure on 17 of the world's largest drug makers to lower U.S. prescription drug prices in 60 days, ahead of proposed tariffs and pharmaceutical impo
Behaviour.js is deprecated Behaviour.js was my library for doing unobtrusive javascript using a combination of a CSS Selector library and some simple javascript. This functionality has now been adopted and improved upon by all the major javascript libraries. I personally use Jquery, which through the .live() method, let's you do all of the functionality of Behaviour.js, but including automatically
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く