Results 1 to 3 of 3

Thread: Image Thumbnail Viewer Gecko bug fix

  1. #1
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Image Thumbnail Viewer Gecko bug fix

    As posted, the otherwise excellent Image Thumbnail Viewer has a bug that only affects Netscape/Mozilla/Firefox based browsers. When an image window first pops up, the dragbar doesn't fully extend the width of the image. Subsequent calls cause the dragbar to extend as expected.

    The bug happens when this line of js is called to draw the dragebar:

    crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Close</span> </div><img src="'+which+'">'

    The fix is pretty simple - give the dragbar a non-zero width. The fix is highlighted below:

    crossobj.innerHTML='<div dragbar width: 1px> <div align="left" id="dragbar"> <span id="closetext" onClick="closepreview()">Close</span> </div> <img src="'+which+'">'

    The CSS can remain the same, although this:

    #dragbar{
    cursor: hand;
    cursor: pointer;
    background-color: #EFEFEF;
    min-width: 100px; /*NS6 style to overcome bug*/
    }

    can now be simplified to:

    #dragbar{
    cursor: hand;
    cursor: pointer;
    background-color: #EFEFEF;
    }

    The dragbar now extends the full width of the image the first time and every time for all browsers (at least IE, and Gecko based browsers). Works fine on PCs and Macs as well, including Safari.

    Frank

  2. #2
    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

    Quote Originally Posted by Frank2056
    <div dragbar width: 1px>
    Either this is a typo or I missed that day at hack school. Unless, as I say, I'm missing something, the only browser that will interpret this as a width is possibly IE. The id will not be applied as, no id= prefix is used. It is uncertain which, if any, browsers will see it as the opening tag for a division however, I see no closing tag. If this fixes anything, it is probably just luck. Did you mean either of these?
    Code:
    <div id="dragbar" width="1">
    or
    Code:
    <div id="dragbar" style="width:1px">
    - John
    ________________________

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

  3. #3
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    Either this is a typo or I missed that day at hack school....

    Did you mean either of these?
    Code:
    <div id="dragbar" width="1">
    or
    Code:
    <div id="dragbar" style="width:1px">
    Actually, it's a typo, and I copied it from a local test .js file, and not the working version from my page.

    Code:
    <div id="dragbar" width="1">
    is what I meant.

    Oddly,
    Code:
    <div id="dragbar" style="width:1px">
    doesn't work.

    Surprisingly, the typo itself also works, although without a border around the image. Go figure.

    Thanks for pointing it out.

    Frank
    Last edited by Frank2056; 05-23-2005 at 04:33 AM.

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
  •