2009-01-14 (水)
■ Whatever:hover の :focus 擬似クラスへの対応について
書くのを忘れていましたが、 Whatever:hover (通称 csshover.htc) のバージョン 3 がリリースされています。 変更点はこんな感じです。
- Ajax で読み込んだソースにも対応
- onmouseover, onmouseout の代わりに onmouseenter, onmouseleave を使用 (参考: onmouseout IE flickering problem)
- ソースコードの整理
ただし、バージョン 2.02 と比較すると、IE6 で :focus が機能しなくなっています。 ちなみに csshover2.htc の場合は、IE7 で :focus が機能しないので、
- csshover3.htc → IE6 で :focus が効かない
- csshover2.htc → IE7 で :focus が効かない
という悩ましいことになっています。
私は IE7 でも :focus が機能する csshover2.htc の改造版 を使っているので、 それをそのまま使い続けてもいいかなという感じなのですが、 もし真面目に対応しようとするのなら、
- IE7 以降では、csshover3.htc を使う
- IE6 以下では、csshover2.htc を使う
という動作にするのがいいかもしれません。 そのためには、例えば、
<head> ...... <!--[if IE]> <link rel="stylesheet" type="text/css" href="/css/ie.css" /> <![endif]--> <!--[if lte IE 6]> <link rel="stylesheet" type="text/css" href="/css/ie6.css" /> <![endif]--> </head>
のように場合分けしておいて、
- ie.css
body {
behavior: url(/js/csshover3.htc);
}
- ie6.css
body {
behavior: url(/js/csshover2.htc);
}
のようにすると、希望の動作にすることができます。
[コメントを書く]
本日のリンク元
- 792 http://fdays.blogspot.com/2009/03/whateverhover-ve...
- 49 google検索(csshover3.htc)
- 49 http://www.clarice-note.com/articles/web/737.html
- 31 google検索(csshover3.htc)
- 11 google検索(csshover3.htc)
- 8 google検索(whatever:hover)
- 7 google検索(csshover3.htc)
- 7 google検索(csshover3.htc)
- 7 google検索(csshover3.htc)
- 7 google検索(csshover3.htc)
- 6 google検索(javascript focus)
- 6 google検索(csshover3.htc)
- 5 google検索(csshover3.htc)
- 5 google検索(whatever:hover)
- 5 google検索(csshover3.htc ie6)
- 5 google検索(csshover3)
- 5 google検索(Whatever:hover)
- 5 google検索(csshover3.htc)
- 5 google検索(javascript focus)
- 5 google検索(ie7 hover javascript)
- 4 google検索(Whatever:hover)
- 4 google検索(ie6 hover 効かない)
- 4 google検索(csshover3.htc)
- 4 google検索(csshover3.htc)
- 4 google検索(csshover2.htc)
- 4 google検索(Whatever:hover)
- 4 google検索(whatever:hover)
- 4 google検索(IE7 focus)
- 4 google検索(csshover3)
- 4 google検索(onmouseenter onmouseleave javascript ie)
- 4 google検索(csshover3.htc)
- 4 google検索(csshover2)
- 4 google検索(f)
- 3 google検索(ie8 csshover.htc)
- 3 google検索(csshover3.htc)
- 3 google検索(csshover2.htc 意味)
- 3 google検索(whatever:hover)
- 3 google検索(javascript focusでなくなったら)
- 3 google検索(csshover3.htcとは)
- 3 google検索(csshover3.htc)
- 3 http://www.google.co.jp/url?sa=t&source=web&cd=1&v...
- 3 http://www.google.co.jp/url?sa=t&rct=j&q=csshover3...
- 3 google検索(whatever:hover )
- 3 google検索(Whatever:hover)
- 3 google検索(whatever:hover)
- 3 google検索(csshover3.htc)
- 3 google検索(csshover3)
- 3 google検索(csshover3.htc)
- 3 google検索(csshover3)
- 3 google検索(whatever:hover focus)
- 3 google検索(csshover3 focus)
- 3 google検索(javascript focus 効かない)
- 3 google検索(javascript focus)
- 3 google検索(csshover3.htc)
- 3 google検索(IE7 疑似クラス csshover focus)
- 3 http://www.google.co.jp/hws/search?hl=ja&q=csshove...
- 3 http://websearch.rakuten.co.jp/?tool_id=1&rid=2000...
- 3 http://74.125.153.132/search?q=cache:bFRshmHWbNoJ:...
- 2 google検索(csshover3.htc)
- 2 google検索(focus擬似クラス css)
- 2 google検索(IE8 擬似クラス)
- 2 google検索(csshover3.htc)
- 2 http://www.google.co.jp/url?sa=t&source=web&cd=4&v...
- 2 http://www.google.co.jp/url?sa=t&source=web&cd=3&v...
- 2 http://www.google.co.jp/url?sa=t&source=web&cd=10&...
- 2 http://www.google.co.jp/url?sa=t&source=web&cd=1&v...
- 2 http://www.google.co.jp/url?sa=t&source=web&cd=1&v...
- 2 http://www.google.co.jp/url?sa=t&rct=j&q=csshover3...
- 2 http://www.google.co.jp/url?sa=t&rct=j&q=csshover ...
- 2 http://www.google.co.jp/url?sa=t&rct=j&q=IE6+hover...
- 2 google検索(Whatever:hover)
- 2 google検索(Whatever:hover)
- 2 google検索(csshover3 csshover2)
- 2 google検索(javascript focus ie7)
- 2 google検索(whatever:hover )
- 2 google検索(csshover 3 forcus)
- 2 google検索(csshover3.htc focus)
- 2 google検索(1h)
- 2 google検索(behavior: url("js/csshover2.htc");)
- 2 google検索(IE7 focus 疑似クラス)
- 2 google検索(csshover3.htc)
- 2 google検索(csshover3.htc)
- 2 google検索(csshover3.htc IE6)
- 2 google検索(csshover3.htc)
- 2 google検索(Whatever:hover)
- 2 google検索(csshover 改造)
- 2 google検索(ie6 focus)
- 2 google検索(whatever:hover )
- 2 google検索(whatever:hover)
- 2 google検索(js/csshover3.htc)
- 2 google検索(javascript styleSheets 擬似クラス)
- 2 google検索(ie7 focus hover)
- 2 google検索(ie7 focus)
- 2 google検索(ie6 hover 効かない)
- 2 google検索(ie6 :hover 擬似)
- 2 google検索(csshover3.htc ie6)
- 2 google検索(csshover3.htc IE7)
- 2 google検索(csshover3.htc)
- 2 google検索(csshover3.htc)
- 2 google検索(csshover3.htc)
