Results 1 to 3 of 3

Thread: Appear/Disappear Problems

  1. #1
    Join Date
    Aug 2010
    Posts
    18
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Appear/Disappear Problems

    you see, my problem is that i'm trying to make an object disappear without changing the "display:block or display:none" in css. because for some reason it screws up my alignments when i set my tables to 100% in width or height. sometimes it even screws up the height or width

    here's the code that toggles from appearing to disappearing
    HTML Code:
      function Appear(itemID){ 
          // Toggle visibility between none and inline 
          if ((document.getElementById(itemID).style.display == 'none')) 
          { 
            document.getElementById(itemID).style.display = 'inline'; 
          } else { 
            document.getElementById(itemID).style.display = 'none'; 
          } 
      }
    and then i use this also

    HTML Code:
    onclick="Appear('Whatever');return false"
    how would i toggle without using css?
    Or At least do it in a different method?

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Sorry I can't see your whole code via my blackberry to be able to offer something specific but try toggling "visibility:hidden" and "visibility:visible" instead as this just hides the element from view but the element still occupies the original space so nothing else will shift into it.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. The Following User Says Thank You to Beverleyh For This Useful Post:

    Clayf700 (01-01-2011)

  4. #3
    Join Date
    Aug 2010
    Posts
    18
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    You... Are... A... MIRACLE WORKER!
    Thanks!

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
  •