Welcome to TalkGraphics.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2012
    Posts
    22

    Default An element to make desappear by clicking a button

    Hello !

    Anybody knows how I can put an element (a frame with text) on a webpage and make it desapear when the visitor click on a button (and make desappear also this button too).

    Thank and best regards !

    Giraf

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,905

    Default Re: An element to make desappear by clicking a button

    Giraf, there are lots of ways to do this.

    Give your text frame a Name. I used myTextBox.
    If it is pure text and not grouped with another element, you must also add the special Name, HTMLBlockText.
    Create your button and Name it. I used myHideButton.

    For the button, you add a Link javascript:hideBox().

    Finally, in the Page > HTML code (head) Placeholder, insert
    Code:
    <script>
    function hideBox()
    {
      document.getElementById("myHideButton").style.visibility="hidden";
      document.getElementById("myTextBox").style.visibility="hidden";
    }
    </script>
    Acorn

  3. #3
    Join Date
    Feb 2012
    Posts
    22

    Default Re: An element to make desappear by clicking a button

    Thanks a lot Acorn ! I will try !

  4. #4

    Default Re: An element to make desappear by clicking a button

    I could not get this to work on any text except a text line. Regardless of how I named the text area HTMLBlockText

  5. #5
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,905

    Default Re: An element to make desappear by clicking a button

    Quote Originally Posted by richinri View Post
    I could not get this to work on any text except a text line. Regardless of how I named the text area HTMLBlockText
    Check out this example against my instructions (#2 above): Only hiding.web

    Acorn

  6. #6

    Default Re: An element to make desappear by clicking a button

    Thanks Acorn! Thanks to the example I was able to figure out what I was doing wrong.

 

 

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
  •