Is it possible to use jQuery to manipulate XUL elements?

前端 未结 6 855
一向
一向 2020-12-08 05:30

I know its possible to integrate jQuery within Firefox addons, but are we able to manipulate (animate, move, adjust transparency, etc) XUL elements themselves?

From

6条回答
  •  攒了一身酷
    2020-12-08 06:08

    XUL and HTML actually deal with opacity the exact same way, and it is jQuery that incorrectly detects what the browser can do. jQuery thinks it's in a different browser when it's living inside XUL, and so opacity effects are handled differently - by jQuery. Since it IS in Firefox, and it should deal with opacity normally, you can override this like so:

    jQuery.support.opacity = true

    Do this right after jQuery is loaded.

    There is probably a whole category of similar fixes that can be post-applied to jQuery to make it behave better, but I haven't looked in to it.

提交回复
热议问题