Can someone please explain this?

Discussion in 'HTML' started by harry, May 26, 2005.

  1. harry

    harry Guest

    Following on from my "bug in IE 5.5" posting yesterday.

    Using IE 5.5 (sp2) - intranet app & no other browser required.

    Using the HTML code (you don't need an image1.gif to see these bizzare
    effects), shown below, why the hell does the image disappear when the
    browser window is widened/ narrowed but stays there if you reduce/increase
    the height? - this does not happen in Firefox!

    This is doing my head in!

    thanks

    harry

    <%@ page contentType="text/html; charset=iso-8859-1" language="java"
    import="java.sql.*" errorPage="" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    </head>
    <script type="text/javascript">
    <!--
    function getElement(id)
    {
    var ctrl=null;

    if(document.all)
    {
    ctrl = document.all[id];

    if(ctrl==null)
    ctrl = document.getElementById(id);
    }
    else
    ctrl = document.getElementById(id);

    return ctrl
    }

    function showObject(id)
    {
    getElement(id).style.display = '';
    }

    function hideObject(id)
    {
    getElement(id).style.display = 'none';
    }

    function onload()
    {
    hideObject('text1');
    hideObject('text2');
    hideObject('text3');
    hideObject('image1');

    showObject('text1');
    showObject('text2');
    showObject('text3');
    showObject('image1');
    }
    -->
    </script>

    <body onLoad="onload();">
    <p id="text1">Text 2</p>
    <p id="text2">Text 2</p>
    <p id="text3">Text 2</p>
    <input type="image" id="image1" src="image1.gif" style="cursor:hand;">
    </body>

    </html>
     
    harry, May 26, 2005
    #1
    1. Advertisements

  2. harry

    Els Guest

    I didn't see that posting. What was it about?
    Please don't just post code, but give a URL to a live example. I don't
    feel like copying your code into an text editor, save it on my
    harddisk, upload it to my server, and then check what happens.

    Nevertheless: Google for peek-a-boo bug, and you may find the answer
    to your question :)
     
    Els, May 26, 2005
    #2
    1. Advertisements

  3. harry

    harry Guest

    thanks for such a fast reply, if I wanted to put this page so you can see it
    via a URL have you any suggestions for free web space.

    I'm working on a company intranet & can't let you see the file on our
    server!

    regards

    harry
     
    harry, May 26, 2005
    #3
  4. No free space at your ISP? Except for the Ma'n'Pa operations, most
    offer a bit.
     
    Blinky the Shark, May 26, 2005
    #4
  5. harry

    harry Guest

    harry, May 26, 2005
    #5
  6. harry

    Els Guest

    [weird disappearing things in IE5.5]
    I see the same thing in Firebird without JavaScript, Firefox with
    JavaScript, IE5.0 and IE5.5 ( no idea about JavaScript settings).

    I see 3 rows of "text 2" and a view button that doesn't work.
     
    Els, May 26, 2005
    #6
  7. Please don't top post in here. Thanks.
    Great. Now the wizards (in which group I do not reside) can have a look
    at it. I'm glad getting it online was that easy. :)
     
    Blinky the Shark, May 26, 2005
    #7
  8. harry

    harry Guest

    if you resize (only seems to disappear when changing width), the browser
    window in IE 5.5 does the view button disappear?

    the onload function serves on to show what happens to an image when it's
    been shown/hidden using it's style.display property

    hope this makes sense?

    thanks

    harry


     
    harry, May 26, 2005
    #8
  9. harry

    Els Guest

    Yes, and indeed in IE 5.5 only. IE 5.0 and 6.0 are both fine.
    No, I don't speak JavaScript at all.

    However, the combination of a disappearing button (which reappears on
    reloading the page) and "shown/hidden using it's [sic] style.display
    property" does make me suspect one has got to do with the other.

    I can't help you figure out what the problem is though, unless you can
    reproduce the problem without the JavaScript? As in static HTML/CSS ?
    Could you please express your gratitude by replying below the bit you
    are quoting, and snipping the irrelevant bits like sigs?

    Thanks :)
     
    Els, May 26, 2005
    #9
  10. harry

    harry Guest

    thanks for your help, looks like I'm stuck with my original workaround -
    hiding/showing buttons every time the windows resizes!


     
    harry, May 26, 2005
    #10
  11. harry

    Els Guest

    Now, how did we tell you to show your gratitude?

    (and besides: I think you're wrong about being stuck with that
    workaround)
     
    Els, May 26, 2005
    #11
  12. harry

    harry Guest

    sorry!

    "(and besides: I think you're wrong about being stuck with that
    workaround)" - It's the only thing that seems to work so for now I can live
    with it!

    many thanks once again

    harry
     
    harry, May 26, 2005
    #12
  13. Blinky the Shark, May 26, 2005
    #13
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.