Tsukimoto Mitsumasa
Tsukimoto Mitsumasa

Reputation: 582

How to toggle a div such that it's movement is up-down?

I have this hidden div,

<div id="lo_p" class="hidden">
    <label for="recipe_id">LO</label>
    <input placeholder="LO for this Recipe" class="all_curve_small cashier_inputs" />
</div>

, and I have this simple toggle function,

$('#id_for_lo').click(function(){
    $('#lo_p').toggle(1000);
});

,normally I wouldn't ask this question because it can be found at api.jQuery.com, but it seems their site is temporarily unavailable. Anyway I want to know if how would I make my toggle effect that it will come from the top, I don't know if you get it, but I have seen toggle usage that the div seems to come from the top, mine here on the other hand is from left to right, not from top to bottom. I'm not sure if you got this but for those who do, your help will be appreciated. Thanks.

Upvotes: 0

Views: 106

Answers (2)

Avinash
Avinash

Reputation: 193

I have used this for the same purpose

$('#id_for_lo').click(function(){
   $('#lo_p').slideToggle({direction: "top" }, 500);
});

Upvotes: 0

Ram
Ram

Reputation: 144659

i think you mean slideToggle(), try this:

$('#id_for_lo').click(function(){
    $('#lo_p').slideToggle(1000);
});

Upvotes: 2

Related Questions