如何使用 GWTQuery 获取对 Window 对象的引用?
标题几乎说明了一切。 我正在尝试使用 jQuery 的功能(希望 GWTQuery 已经实现了它)将回调函数传递给 window.resize ,如下所示(来自 jquery 站点的示例):$(窗口).resize(function(){
但是当我尝试在 Eclipse 中输入
警报(“停下来!”);
});$(window)
时,出现无法解析 window
的错误。 如果有人对更大的图片感兴趣,我基本上会尝试从窗口中获取已完成调整大小操作的指示,从而可进一步调整大小。
感谢您的帮助 一泰 PS,请不要进行有关浏览器开发和调整大小的讲座,因为我正在开发一个恰好使用浏览器的内部应用程序。
The title pretty much says it all.
I'm trying to use jQuery's ability (hoping GWTQuery has implemented it) to pass a callback function to the window.resize something like this(example from jquery site):$(window).resize(function(){
alert("Stop it!");
});
but when I tryi to type $(window)
in Eclipse I get an error that window
can not be resolved.
If anyone's interested in the bigger picture I'm basically trying to get an indciation from the window that is has finished the resizing operation and thus available for further resizing.
Thanks for any help
Ittai
P.S. please no lectures about browser development and resizing as I'm developing an in house app which just happens to use a browser.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
自 2010 年 5 月 3 日起,此功能已添加到 GWTQuery。请参阅 http://code.google.com/p/gwtquery/issues/ detail?id=32
需要导入:
此后,您可以使用以下命令访问窗口。
但是,不存在 resize() 函数。要响应窗口大小调整,您可以将 ResizeHandler 注册到 GWT 自己的窗口类,如下所示:
This functionality has been added to GWTQuery as of 2010-05-03. See http://code.google.com/p/gwtquery/issues/detail?id=32
Imports required:
after this, you can access the window using
However, no resize() function exists. To respond to a window resize, you can instead register a ResizeHandler to GWT's own window class, like this:
好的,
据我所知,测试和信息搜索 GWTQuery 不支持检索窗口的 jQuery 语法。这可能与 GWT 已经有一个 Window 类有关(尽管它很部分),但我不确定。
目前(12 月 9 日)情况如此,将来可能会发生变化。
OK,
To the best of my knowledge, testing and info searches GWTQuery does not support the jQuery syntax of retrieving the window. This might be related to the fact that GWT has already a Window class (although it is very partial) but I'm not sure.
This is true for the time being (Dec` 09) and might change in the future.