Results 1 to 9 of 9

Thread: DHTML Window Widget help

  1. #1
    Join Date
    Aug 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default DHTML Window Widget help

    1) Script Title: DHTML Window Widget

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...dhtmlmodal.htm

    3) Describe problem:
    When a link is clicked, a window opens up with a Flash-based music player. When it is playing music and you click Minimize, the music stops playing. Why? How do I make it so it does not stop? Can I use the hide() function or do I have to fiddle with the Javascript code in some way? I don't know JS much so any help would be appreciated.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Find this in your js:
    Code:
    minimize:function(button, t){
    	dhtmlwindow.rememberattrs(t)
    	button.setAttribute("src", dhtmlwindow.imagefiles[2])
    	button.setAttribute("title", "Restore")
    	t.state="minimized" //indicate the state of the window as being "minimized"
    	t.contentarea.style.display="none"
    	t.statusarea.style.display="none"
    	if (typeof t.minimizeorder=="undefined"){ //stack order of minmized window on screen relative to any other minimized windows
    		dhtmlwindow.minimizeorder++ //increment order
    		t.minimizeorder=dhtmlwindow.minimizeorder
    	}
    	t.style.left="10px" //left coord of minmized window
    	t.style.width="200px"
    	var windowspacing=t.minimizeorder*10 //spacing (gap) between each minmized window(s)
    	t.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-windowspacing+"px"
    },
    And change it to this:
    Code:
    minimize:function(button, t){
    	dhtmlwindow.rememberattrs(t)
    	button.setAttribute("src", dhtmlwindow.imagefiles[2])
    	button.setAttribute("title", "Restore")
    	t.state="minimized" //indicate the state of the window as being "minimized"
    	t.contentarea.style.visibility="none"
    	t.statusarea.style.visibility="none"
    	if (typeof t.minimizeorder=="undefined"){ //stack order of minmized window on screen relative to any other minimized windows
    		dhtmlwindow.minimizeorder++ //increment order
    		t.minimizeorder=dhtmlwindow.minimizeorder
    	}
    	t.style.left="10px" //left coord of minmized window
    	t.style.width="200px"
    	var windowspacing=t.minimizeorder*10 //spacing (gap) between each minmized window(s)
    	t.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-windowspacing+"px"
    },
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    DinoCow (08-26-2008)

  4. #3
    Join Date
    Aug 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    You are truly awesome. Thank you so very much for your help! It worked like charm.

    Have a great day.

  5. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    @DinoCow
    Night for me. Glad to help
    Jeremy | jfein.net

  6. #5
    Join Date
    Aug 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hmm. It looks like the contentarea.style. line is the cause of the problem. Weird thing is that when I minimize the window now, the content still shows attached to the bottom of the minimized window title bar... I tried adding a t.style.height="17px" line under the .width line, but that did not solve it. Any suggestions?

  7. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Change:
    Code:
    restore:function(button, t){
    	dhtmlwindow.getviewpoint()
    	button.setAttribute("src", dhtmlwindow.imagefiles[0])
    	button.setAttribute("title", "Minimize")
    	t.state="fullview" //indicate the state of the window as being "fullview"
    	t.style.display="block"
    	t.contentarea.style.display="block"
    	if (t.resizeBool) //if this window is resizable, enable the resize icon
    		t.statusarea.style.display="block"
    	t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px" //position window to last known x coord just before minimizing
    	t.style.top=parseInt(t.lasty)+dhtmlwindow.scroll_top+"px"
    	t.style.width=parseInt(t.lastwidth)+"px"
    },
    To:
    Code:
    restore:function(button, t){
    	dhtmlwindow.getviewpoint()
    	button.setAttribute("src", dhtmlwindow.imagefiles[0])
    	button.setAttribute("title", "Minimize")
    	t.state="fullview" //indicate the state of the window as being "fullview"
    	t.style.visibility="visible"
    	t.contentarea.style.display="visible"
    	if (t.resizeBool) //if this window is resizable, enable the resize icon
    		t.statusarea.style.display="visible"
    	t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px" //position window to last known x coord just before minimizing
    	t.style.top=parseInt(t.lasty)+dhtmlwindow.scroll_top+"px"
    	t.style.width=parseInt(t.lastwidth)+"px"
    },
    And then change the code I gave you above to this:
    Code:
    minimize:function(button, t){
    	dhtmlwindow.rememberattrs(t)
    	button.setAttribute("src", dhtmlwindow.imagefiles[2])
    	button.setAttribute("title", "Restore")
    	t.state="minimized" //indicate the state of the window as being "minimized"
    	t.contentarea.style.visibility="hidden"
    	t.statusarea.style.visibility="hidden"
    	if (typeof t.minimizeorder=="undefined"){ //stack order of minmized window on screen relative to any other minimized windows
    		dhtmlwindow.minimizeorder++ //increment order
    		t.minimizeorder=dhtmlwindow.minimizeorder
    	}
    	t.style.left="10px" //left coord of minmized window
    	t.style.width="200px"
    	var windowspacing=t.minimizeorder*10 //spacing (gap) between each minmized window(s)
    	t.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-windowspacing+"px"
    },
    Jeremy | jfein.net

  8. #7
    Join Date
    Aug 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your help, Nile! I don't think I'd ever figure this out on my own.

    I think you've just about fixed this problem... it minimizes, but the minimized window still shows the content, although now it's all contained within the window instead of the content just jutting out like a tail.

    Maybe it's easier to understand if you saw the source of the problem:
    http://www.dinocow.net/
    (I'm an amateur at web design, please don't laugh at me. :-P )

    The link I'm most concerned with is the Music box, which is the mid-right icon (piano keyboard).

    One oddity of great interest that I noticed earlier, before the most recent changes you made, when the content was jutting outside of the window's bottom borders ("like a tail") and I clicked on the window's title bar to move it around, the content portion would disappear when my mouse was clicked on the title bar and then would reappear when I let go of it. Do you think that could be used to make the content disappear permanent while the window is minimized?

    Thanks again for your generous help.

  9. #8
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I've tried my best, lol. Looked at the code, I don't have a clue, I'm sorry.
    Jeremy | jfein.net

  10. The Following User Says Thank You to Nile For This Useful Post:

    DinoCow (08-27-2008)

  11. #9
    Join Date
    Aug 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    No need to be sorry. You've helped a great deal. Thanks again and have a great day!

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
  •