PDA

View Full Version : can I control iframe's loading in parent html?



hahaEr2003
22 May 2007, 6:38 AM
can I control iframe's loading in parent html?
I want control iframe's loading in parent html ,just like control div. for examle,I want to show a mask when iframe's src loading,and unmask when loaded,just like control div.
I try to use el.load(),el.seturl,....etc.
but I fail!
so,can I do this?and how?

BernardChhun
22 May 2007, 7:33 AM
adding a listener to the iFrame's beforeload event should work:


iframe.on("beforeload", function(){ /*show mask*/}, this, true);

then on the load event:


iframe.on("load", function(){ /*hide mask*/}, this, true);

et voila!

neror
22 May 2007, 8:53 AM
See this thread:

http://extjs.com/forum/showthread.php?t=6143

hahaEr2003
26 May 2007, 4:12 AM
thank for BernardChhun & neror
I try for it ,beforeload don't work,but load works,thanks again.