jQueryプラグイン「PNG Fix」を利用してIE6で背景画像に透過PNGを使用する
- http://plugins.jquery.com/project/iepngfix
- Campbell Digital Soup – Prague – Center of Medical Tourism
IE7.js, jquery.pngFix.js を経て jquery.pngfix.js(fが小文字)。
使い方
<head> ... <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.pngfix.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("SELECTOR").pngFix(); }); </script> ... </head>
注意
- 繰り返しの背景画像は非対応
- background-position は left top(0 0)のみ対応
- 適用した要素の子孫要素(a, input, textarea 等)がクリックできない場合がある
- クリックさせたい子孫要素を position: relative; に、それらの親(先祖)要素を position: static; にすることで回避可能。
個人的には、そこまでして透過PNG使わなくても…と思うわけではありますが。