如何捕获IE窗口调整大小事件 [英] How to catch IE window resize event
问题描述
嗨
我有一个课程,我已经为 IHTMLWindow2 实现了 IDispatch 界面。
用于捕捉窗口调整大小方法。现在调用现在调用,但我仍然无法在 DISPID_WINDOWRESIZE 中跟踪该事件。如何捕获IE窗口调整大小事件。
提前谢谢。
Hi
I have a class in which i have implemented IDispatch interface for IHTMLWindow2.
For catching window resize method.Now invoke is getting called,but still i am not able to trace that event in DISPID_WINDOWRESIZE. How can i catch IE window resize event.
Thanks in advance.
推荐答案
JQuery has a built-in method for this:
(窗口).resize(function(){/ *做某事* /});
为了UI响应,您可以考虑使用setTimeout仅在几毫秒之后调用您的代码,如以下示例所示,灵感来自:
函数doSomething( ){
alert(我现在正在调整大小);
};
var resizeTimer;
(window).resize(function () { /* do something */ }); For the sake of UI responsiveness, you might consider using a setTimeout to call your code only after some number of milliseconds, as shown in the following example, inspired by this: function doSomething() { alert("I''m done resizing for the moment"); }; var resizeTimer;
(window).resize(function(){
clearTimeout(resizeTimer);
resizeTimer = setTimeout(doSomething ,100);
});
(window).resize(function() { clearTimeout(resizeTimer); resizeTimer = setTimeout(doSomething, 100); });
还要检查它们:
http://stackoverflow.com/questions/1852751/window- resize-event-firing-in-internet-explorer [ ^ ]
http://mbccs.blogspot.in/2007/11/fixing-window-resize-event-in-ie.html [ ^ ]
http:/ /remysharp.com/2008/05/15/windowonresize-hangs-ie6-and-ie7/ [ ^ ]
Also check them:
http://stackoverflow.com/questions/1852751/window-resize-event-firing-in-internet-explorer[^]
http://mbccs.blogspot.in/2007/11/fixing-window-resize-event-in-ie.html[^]
http://remysharp.com/2008/05/15/windowonresize-hangs-ie6-and-ie7/[^]
这篇关于如何捕获IE窗口调整大小事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!