0

I have two divs which I want to simulate a slider but not actually use a slider, is it possible to use animate to simulate a div a sliding in from the right?

$('a.next').click(function(){
   $("#inside_work.part-one").hide();
   $("#inside_work.part-two").animate('slide', { direction: 'left' }, 500);
}); 
1
  • You can try using jQuery's animate function on the Div width. Set the beginning width to 0% & then animate it to 100%
    – Scorpio
    Aug 14, 2012 at 14:54

1 Answer 1

0

Everything you need is right here.

JQuery Slide Demo

    // click 
    $( "#inside_work.part-two" ).click(function() {
        //options and callback are optional
        var options = {};
        $("#inside_work.part-one").hide();
        $( "#effect" ).show( "hide", options, 500, callback );
        return false;
    });

    //callback function
    function callback() {
        //anything else you want to do here.
        //but completely optional
    };

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.