View Full Version : DHTML Window Widget Iframe Resize Problem

06-04-2008, 04:32 PM
1) Script Title: DHTML Window Widgets

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/

3) Describe problem:

When content is opened up in an iframe and the iframe is dragged/resized over another open dhtml WW iframe, the process lags horribly. In contrast, the ajax form of the WW has no lag whatsoever (and I would use that if the ajax returned content would properly execute javascript, but it doesn't).

Is there any way at all to eliminate the resize/move lag when using iframes? Or is there a way perhaps to get javascript content to function correctly inside of an ajax window?


06-04-2008, 07:11 PM
I've found the lag when dragging usually correlates with the complexity of the page contained inside the IFRAME. The script already tries to minimize this by "hiding" the iframe page while it's being dragged. I'm not sure there's much more that can be done, since this is a browser specific issue (FF seems to be more laggy than IE), and not an inefficiency in the script itself.

06-04-2008, 07:18 PM
Is there anyway I can make my javascript libraries (OAT) work within the ajax created windows?

06-04-2008, 08:17 PM
This is a pesky limitation of Ajax. Pages fetched via Ajax should they contain JavaScripts within it in many cases won't run correctly when brought over this way. Ajax basically copies the contents of the external file similar to copying plain text and just dumps it onto the main page. Scripts that should be run during runtime are taken out of their required context when you do an asynchronous transfer of them using Ajax.

There are a few workarounds to this limitation, but the solution is specific and dependent on the scripts involved, and can get very messy. You may be able to get away with adding the libraries to the main page that's launching the DHTML Window, so they are run at runtime and yet lie dormant until the Ajax page is fetched. However, in other cases, you need to dynamically load the libraries after the Ajax page is fetched, and only after. That's where things get tricky.