www.webdeveloper.com
Results 1 to 2 of 2

Thread: How transition works?

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Posts
    373

    How transition works?

    Hi,

    i made a simple toggle visibility button with javascript and css:

    Code:
    function toggle(iden) {
    if(document.getElementById(iden).className=="exp_open") {
    document.getElementById(iden).className="exp_close";
    } else{
    document.getElementById(iden).className="exp_open";
    }
    }
    Code:
    .exp_close {
        display: none;
    }
    
    
    .exp_open {
        display: block;
        transition:all 1s;
    }
    Code:
    <h2 onclick="toggle('block1');"></h2>
    <div id="block1" class="exp_close"></div>
    what im trying to achieve is a smooth slide-like effect instead of having the element just appear and disappear by using css transition property but i really dont understand quite well how to use it. Could you please give me a hint?

    Thank you.

  2. #2
    Join Date
    Jul 2006
    Posts
    373
    Forget it... i had to figure it out myself...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles