Safari giving problem with {display:none}

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    Safari giving problem with {display:none}

    All the elements which were set as style={display: none} are still being shown in Safari (Apple's Browser)...

    But when the same style is applied with javascript on an event, it hides the element.
    Like this...
    Code:
    document.getElementById('abc').style.display='none';
    This one is also not working:
    [HTML]style="{backgro und-image:url('/img/logo.png');back ground-repeat:no-repeat}" [/HTML]

    Both are working all good with Firefox, Opera and even IE 6 (which I actually didn't expect).

    What could be the reason?
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    #2
    If you're using them as inline styles simply remove the curly braces.

    [CODE=css] style="display: none;"[/CODE]

    As for the image do the same and add a space between the colon and 'url'.

    [CODE=css] style="backgrou nd-image: url('location') ;"[/CODE]

    Thanks,
    {\_/}
    (' . ')
    (")[DEATH](")
    (")(")

    Comment

    • hsriat
      Recognized Expert Top Contributor
      • Jan 2008
      • 1653

      #3
      Originally posted by Death Slaught
      If you're using them as inline styles simply remove the curly braces.

      [CODE=css] style="display: none;"[/CODE]

      As for the image do the same and add a space between the colon and 'url'.

      [CODE=css] style="backgrou nd-image: url('location') ;"[/CODE]

      Thanks,
      {\_/}
      (' . ')
      (")[DEATH](")
      (")(")
      oo.... thats working now!!
      Thanks a lot!!! :)

      Can you please tell me one more thing...
      [HTML]<a class="button" id="ax1" href="javascrip t:void(0)" onclick='edit(' x1')">&nbsp;Edi t&nbsp;</a>[/HTML]

      and function edit(id) is
      Code:
      function edit(id) {
      	var anc = document.getElementById('a'+id);
       	anc.innerHTML = anc.innerHTML=="&nbsp;Save&nbsp;" ? "&nbsp;Edit&nbsp;" : "&nbsp;Save&nbsp;";
      }
      This is working fine with Firefox and IE, ie, the name of the A element gets changed from ' Save ' to ' Edit ' and ' Edit ' to ' Save ' on every click. But Opera and Safari are not doing any change.
      If I remove the &nbsp; from both, then its working fine with all.
      But since its a button kind of look, so I need to give space on both sides of the name.

      How can I solve this?

      Comment

      Working...