Displaying hiding div on page load

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emmanuelop
    New Member
    • Mar 2008
    • 1

    Displaying hiding div on page load

    Hello ,

    I'm trying to show or hide a div tag based on whether a user is signed in or not.There is a value set to a logged in users name contained in a rails script tag and it is this value which I wish to assign to a javascript variable and if it is empty show the div and if it conains something hide the div.All this I want to do on page load.Any tps on how to go about this. All i've been able to find regarding this was diplaying or hiding the div by calling a function when a user clicked a link or button.
    Ay tips or help will be greatly appreciated.

    Manuel
  • pronerd
    Recognized Expert Contributor
    • Nov 2006
    • 392

    #2
    This is a pretty common use of JavaScript you should be able to google and find literally thousands of examples of how to do this. Basically you just want to change the value of either the display or visibility attributes for the div tag in question.

    Comment

    Working...