Sanjeev K Sanjeev K - 1 year ago 179
CSS Question

JQuery load with animation/transition

I am loading

on click with jQuery load method, its working fine but I wanted to add animation like slideUp/slideDown effect, but not sure how to achieve this:

following is the code

$('.search_bar > input').click(function(){
$("body").css({"overflow": "hidden", "height": "auto"});

Can anyone please suggest how to add slideUp/Down transition, I tried CSS transition as well but no luck

thanks in advance!

Answer Source

Use .load(url, callback) to do stuff after element is loaded. First set it's display: none via css, than do

    function () {
        $('#search_layer .div-to-show').slideDown();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download