Sri
Sri

Reputation: 39

JQuery slide horizontal onclick

Can you please tell me how to use slide div in horizontal when onclick Prev/Next images using ajax load in jQuery.

My logic looks like this :

jQuery("#appt_1").click(function() {
    jQuery("#appt_1").load("/test/get_later_slots")
 });

Upvotes: 0

Views: 3131

Answers (3)

Pooja
Pooja

Reputation: 170

you can use animate option in jquery and slide ur div to left or right!

ex.

$("#id1").click(function() {
    $("#id2").animate ({
right:'120px', opacity:'1'},500);

});

initially i ll keep the opacity:0 for #id2 so as to keep it hidden and on click will change the opacity to 1 as simple as that!!

Upvotes: 0

rogerlsmith
rogerlsmith

Reputation: 6786

I have used this to slide a div right and "delete it" from a set

$('#'+val).hide('slide', {direction: 'right'}, 500, function() {
            $('#'+val).remove();
        });   

You may be able to modify it to work for your situation.

Upvotes: 2

Ricardo Binns
Ricardo Binns

Reputation: 3246

if you prefer to use a plugin, i suggest to use this one:

Upvotes: 0

Related Questions