• Post Reply Bookmark Topic Watch Topic
  • New Topic

Safari - issues with style.display  RSS feed

 
Ranch Hand
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using the following in all browsers and it appears to work in all browsers


afterwards I try doing the following



but that does not work in Safari. Any ideas why it doesn't work in Safari while it works in the other browsers? Version 5.1 of Safari.
 
Rob Hunter
Ranch Hand
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Does not work" => the element the id belongs to doesn't appear.
 
Author and ninkuma
Marshal
Posts: 66729
167
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The empty string is not a valid value for the display property. you should be using one of the valid values such as block, inline or inline-block.

Or, you might try removing the property from the object completely, but I've never tried that myself.
 
Rob Hunter
Ranch Hand
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've also tried using inline, block, and a few others as well - still no luck.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66729
167
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I'd be using CSS and classes for this, or at minimum jQuery's .hide() and .show() -- life is too short to deal with cross-browser issues in raw JavaScript.

Can you post an SSCCE or fiddle that demonstrates the problem? Using a valid value for the property should work on all browsers.
 
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!