SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Element.toggle

Hybrid View

  1. #1
    SitePoint Enthusiast Stevenwulf's Avatar
    Join Date
    May 2002
    Location
    Berkeley
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Element.toggle

    I'm using the Prototype library's toggle feature.

    Code:
     <a href='#' onclick="Element.toggle('element_id'); return false;">
     toggle
     </a>
    the problem, is that the first time you come to the page the element is displayed. How do you set it to hide the element by default?

    -steven

  2. #2
    SitePoint Guru 33degrees's Avatar
    Join Date
    May 2005
    Posts
    707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you'd have to do this in the css, try giving you element a style of "display: none"

  3. #3
    Awesome Addict
    Join Date
    Mar 2004
    Location
    Toronto, Canada
    Posts
    326
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by 33degrees
    you'd have to do this in the css, try giving you element a style of "display: none"
    ... either that or an inline display:none.

  4. #4
    SitePoint Enthusiast Stevenwulf's Avatar
    Join Date
    May 2002
    Location
    Berkeley
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Setting the display element to "none" got it working right.

    Thanks,
    Steven


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •