0

I am new to jQuery. I have learned functions like SlideUp and Down but I can't find anything like Slide Left and Right.

I want to make a content slide with horizontal sliding effects. I have achieved vertical sliding in it. I dont want to use an existing plugin or library. I want to build my own.

Please guide me !

0

4 Answers 4

2

Here is a great tutorial to slide elements in different directions.

0
2

Here is an example using animate(). This can easily be adpoted to be a jQuery function rather than JS functions

$('#slidein').click(function(){
    $('div').stop().animate({
        'width':'500px'
    }, 500);
});

$('#slideout').click(function(){
    $('div').stop().animate({
        'width':'0px'
    }, 500);
});
1

You should be able to use the animate() function as described here to adjust the width property of the element you want to animate.

There are a number of examples on that page so you should be able to play with what's there to achieve your desired effect.

1

Maybe JCycle can be suitable for you. It supports a lot of changing slide such as up, down, left, right, fade in/out, ....

You can download and view demo at this website : http://jquery.malsup.com/cycle/

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.