Results 1 to 2 of 2

Thread: DHTML Window Widget: carelessness?

  1. #1
    Join Date
    Mar 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DHTML Window Widget: carelessness?

    1) Script Title: DHTML Window Widget

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

    3) Describe problem: Not so much bugs as some things overlooked...


    ----- dhtmlwindow.js
    line 25 seems out of place and not needed: it looks like it closes a div that doesn't exist
    - to illustrate
    - following are lines 20 to 25
    -- expanded with my comments:

    domwindowdata='<div class="drag-handle">'
    // first div opened (drag-handle)

    domwindowdata+='DHTML Window <div class="drag-controls"><img src="'+this.imagefiles[0]+'" title="Minimize" /><img src="'+this.imagefiles[1]+'" title="Close" /></div>'
    // second div (drag-controls) opened and closed - first div still open (drag-handle)

    domwindowdata+='</div>'
    // first div closed (drag-handle) - no div is open

    domwindowdata+='<div class="drag-contentarea"></div>'
    // third div (drag-contentarea) opened and closed - no div is open

    domwindowdata+='<div class="drag-statusarea"><div class="drag-resizearea" style="background: transparent url('+this.imagefiles[3]+') top right no-repeat;">&nbsp;</div></div>'
    // two divs (drag-statusarea and drag-resizearea) are opened and closed - no div is open

    domwindowdata+='</div>'
    // [ line 25 ] so what div does this close?



    ------------------------------------------------

    AND

    ----- images: min.gif and resize.gif
    speak about BLOAT - these two images use an indexing of colors that go far beyond the scope of what's called for:

    min.gif - 872 bytes

    resize.gif - 859 bytes

    when each could be easily around 80 to 90 bytes if properly indexed--- i know we're talking only bytes - but still - all the other control images are around 125 bytes - you think someone would have noticed the difference in these two images...

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

    Default

    You're right, the last closing </div> shouldn't be there:

    Code:
    domwindowdata+='</div>'
    Regarding the images, guilty as charged I always envisioned people customizing that part of the window interface, so didn't bother with optimizing any of the images.

    I'll get to fixing both of the above soon.

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
  •