Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript fadeToggle jquery

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38420
    dynamyc
    Member

    Hello!
    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?
    Thanks!

    #104095
    Taufik Nurrohman
    Participant
    $("#searchbox").hide(); // Hide by default
    $("button").click(function() {
    $("#searchbox").fadeToggle("slow", "linear").find(".close").on("click", function() {
    $(this).parents("#searchbox").fadeOut("slow");
    return false;
    });
    });

    http://jsfiddle.net/tovic/KaeT7/1/

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.