Web Analytics Made Easy -
StatCounter Mozilla style.display formatting problem - CodingForum

Announcement

Collapse
No announcement yet.

Mozilla style.display formatting problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mozilla style.display formatting problem

    I am using style.display to selectively show certain options based upon a user's radio button selection.

    style.display closes up un-displayed options space, which is what I want.

    This works great in IE, but in Mozilla, it does not properly close up the undisplayed space. I am ussing "block" or "none" to control show/hide.

    If I do a refresh, then Mozilla properly reformats.

    Is there some way to get Mozilla to properly format after doing an item.style.display='none' or maybe force a refresh?

    Thanks,
    -- Frank

  • #2
    We need to see your code to make any suggestions. What I think is happening is item is the name of the div and not the id. In which case you should be using document.getElementById(item).style.display but thats just a guess. So post your code.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

    Comment


    • #3
      I found the answer to my problem.

      I had put the display property on the tr and td elements of my table.

      IE seems fine with this, but not Mozilla.

      When I moved the display control tags to div elements then Mozilla was also happy.

      -- Frank

      Comment


      • #4
        Mozilla would need to have it set to display='table-row' or display='table-cell', which then IE will not support. So the best thing to do, is to set it back to the default display, by nullifying the style.display.

        ie.

        Code:
        obj.style.display='none';
        
        and
        
        obj.style.display="";
        So long as in the stylesheet you have not specified that the element should load hidden, it will appear when you remove the inline style declaration. Div's will work too, but if you HAVE to have it in a table, that'll do ya.

        Basscyst
        Helping to build a bigger box. - Adam Matthews

        Comment

        Working...
        X