slide down effect with jquery
Question by Thomas
suppose i have one div which has data. i want when i will click on a button then a new div will be created and which will cover the actual div like shutter down. here is sample code i got from a site which is very close but not the way i want.
$(document).ready(function() {
var $box = $('#box')
.wrap('<div id="box-outer"></div>');
$('#blind').click(function() {
$box.blindToggle('slow');
});
});
check the demo of above code http://www.learningjquery.com/2008/02/simple-effects-plugins
just go to site and click on blind toggle button just to see how i want the things.
i want when button will be click then a new div will be created and the new div will cover the actual div with slide down effect and when i will click again then new div will slide up.how to implement it using jquery. guide me with sample code if possible. thanks
Answer by kei
The link you’ve provided pretty much have the code already for you. You just need a few tweaks.
Answer by Starx
There are already native function .slideUp()
and .slideDown()
which do what you want.
Update: Not sure if i understood it correctly but, here is a demo.