Treehouse: Grow your CSS skills. Land your dream job.

fadeToggle jquery

  • # June 8, 2012 at 8:18 am

    I’m trying to replicate the html5rocks “Search”.
    Here is my attempt: jsfiddle

    My question is what is the best practice to achieve this, how can I hide by default the searchbox div and how to append a “close” button with the same fading effect?

    # June 8, 2012 at 9:53 am
    $("#searchbox").hide(); // Hide by default
    $("button").click(function() {
    $("#searchbox").fadeToggle("slow", "linear").find(".close").on("click", function() {
    return false;

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.