是否有可能使用jQuery来操纵XUL元素? [英] Is it possible to use jQuery to manipulate XUL elements?

查看:207
本文介绍了是否有可能使用jQuery来操纵XUL元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以将jQuery整合到Firefox插件中,但是我们是否可以操纵(动画,移动,调整透明度等)XUL元素本身?

我的理解是,Firefox插件可以使用jQuery来操作HTML / DOM元素,但不能确定XUL元素。

XUL和HTML实际上处理不透明度完全相同的方式,这是jQuery不正确地检测浏览器可以做什么。当jQuery生活在XUL中时,jQuery认为它是在不同的浏览器中,所以不透明度效果的处理方式不同 - 通过jQuery。由于它是在Firefox中,它应该正常处理不透明,你可以重写这样的:

jQuery.support.opacity = true

在jQuery加载完成之后做这件事。



可能有一整套类似的修补程序可以后置到jQuery中它表现的更好,但我没有看着它。


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 what I understand, the Firefox addon can use jQuery to manipulate HTML/DOM elements, but not sure about XUL elements.

解决方案

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.

这篇关于是否有可能使用jQuery来操纵XUL元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆