Search code examples
jqueryeffectsmoothing

jquery smooth effect


I want to make something similar with this

When you click on "description" text appears. I want to create this effect with jQuery, how can I make this?


Solution

  • Perhaps a fadeToggle() ?

    <a href="#" id="appear">Clicky</a>
        <p class="textTo" style="display: none;">Hello World!</p>
    
    <script type="text/javascript">
    $("#appear").click(function() {
       $(".textTo").fadeToggle();
    });
    </script>
    

    check out the working fiddle: http://jsfiddle.net/vfcp4/

    and the api:

    http://api.jquery.com/fadeToggle/

    the api shows a bit more.

    for example there are some parameters to pass controlling animation speed, type, etc.