4

私は次のことを試しました:

(オーバーレイはクロム/サファリでは表示されないため、これは実際にはファンシーボックス用です:

   $("#fancy_overlay").css({<br />
                    'background-color': opts.overlayColor,<br />
                    'opacity': opts.overlayOpacity,<br />
                    '-moz-opacity': opts.overlayOpacity,<br />
                    '-khtml-opacity': opts.overlayOpacity,<br />
                    '-webkit-opacity:' : opts.overlayOpacity<br />
    }).show();

それでも何もありません(クロム/サファリで)

私は何を間違っていますか?

4

1 に答える 1

12

opacity should work for chrome/safari/firefox. The -moz and -khtml syntaxes are only used to support the much older versions of these browsers.

I've never run across the -webkit-opacity style before and can't seem to find any documentation that says it exists. I would try removing it entirely or fixing the syntax bug you have in there: '-webkit-opacity:' to '-webkit-opacity' (without the trailing colon).

If that doesn't work try printing the value of opts.overlayOpacity. Make sure it's something like 0.5 and not 50 or 50%.

于 2009-11-18T17:09:32.383 に答える