作者:jiangping最棒_766 | 来源:互联网 | 2023-06-21 10:38
IjuststartedusingjQuery.NowIwanttouseanjQuerymethodwithanelementobject.我刚开始使用jQuery
I just started using jQuery. Now I want to use an jQuery method with an element object.
我刚开始使用jQuery。现在我想使用jQuery方法来处理元素对象。
var element = document.elementFromPoint(x, y);
element.offset();
Of course this doesn't work because the variable element is not a jQuery selector, so the error message I get in Firebug is "element.offset is not a function". Is there any general method I could use this element object with an jQuery selector?
当然,这不能工作,因为变量元素不是jQuery选择器,所以我在Firebug中得到的错误消息是“element”。偏移不是函数。有什么通用的方法可以用jQuery选择器使用这个元素对象吗?
2 个解决方案