Results 1 to 6 of 6

Thread: DHTML Window widget

  1. #1
    Join Date
    Aug 2006
    Posts
    27
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default DHTML Window widget

    1) Script Title: DHTML Window widget (v1.03)

    2) Script URL (on DD): http://dynamicdrive.com/dynamicindex...ndow/index.htm

    3) Describe problem:

    I've embedded a flash movie into the popup, but if I press play on the movie and then close the window, the movie continues to play in the background (you can still hear the sound).

    Is there any way to shut off the contents inside the window when hitting the close button? Here is a test page:

    http://musclegaintruth.com/widget.htm

    Any suggestions would be awesome,

    Thanks,

    Sean

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    That's because the close() function right now doesn't really stop any of the content within the window from loading, just hide the window. This is out of consideration for the show() function.

    A quick but less than ideal solution right now is to add the line:

    Code:
    	if (closewinbol){ //if custom event handler function returns true
    		if (t.state!="minimized") //if this window isn't currently minimized
    			dhtmlwindow.rememberattrs(t) //remember window's dimensions/position on the page before closing
    		t.style.display="none"
    		t.contentarea.innerHTML=""
    	}
    The line in red is new inside dhtmlwindow.js. It should empty the window contents when it is closed.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    With flash though, in IE, just getting rid of the innerHTML might not be enough. I've found that using an iframe to display the flash works out. If you then change the iframe's src attribute, that stops the flash. I don't think the widget script does this automatically though. It (changing the src attribute of an iframe) is the same as changing the top page would be, that also stops flash.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Aug 2006
    Posts
    27
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    With flash though, in IE, just getting rid of the innerHTML might not be enough. I've found that using an iframe to display the flash works out. If you then change the iframe's src attribute, that stops the flash. I don't think the widget script does this automatically though. It (changing the src attribute of an iframe) is the same as changing the top page would be, that also stops flash.
    Thanks guys...

    What do I need to change the iframe src attribute to?

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    A blank page if you want to. For example, just make a blank webpage file (blank.htm) with absolutely nothing in it, and set it as the src.
    - Mike

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    An iframe's src attribute may also be changed to about:blank, ex:

    Code:
    document.getElementById('iframe_id').src='about:blank';
    This works in all modern browsers. It also saves having to make up a blank page. The only exception I know of would be if you are on a secure page. Then you would need a blank secure page to avoid a security warning.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •