Reputation: 309
How can I change the fade to slide left/right?
changeList = function () {
listItems.eq(i).fadeOut(transition_speed, function () {
i += 1;
if (i === listLen) {
i = 0;
}
listItems.eq(i).fadeIn(transition_speed);
});
};
I've found a code; however, don't know how to implement because the first part (fade out) has a function attached.
.show( "slide", {direction: "left" }, 2000 );
and then
.hide( "slide", {direction: "left" }, 2000 );
is that the best way to achieve this, or is there a better way?
------EDIT------
changeList = function () {
listItems.eq(i).hide({
easing : "slide",
direction: "left",
duration : 2000,
complete: function(){
i += 1;
if (i === listLen) {
i = 0;
}
listItems.eq(i).show({
easing : "slide",
direction: "left",
duration : 2000 });
}
});
};
This edit didn't work. I probably implemented it wrong
Upvotes: 1
Views: 66
Reputation: 303
use this toggling effect
$("#left_panel").toggle("slide", { direction: "left" }, 1000);
i have edited.
$('a.view-list-item').click(function () {
var divname= this.name;
$("#"+divname).show("slide", { direction: "left" }, 1000);
$("#"+divname).parent().siblings(":visible").hide("slide", { direction: "left" }, 1000);
});
Upvotes: 0
Reputation: 124
You can do it without jQuery UI.
use .animate({ width: property }, 2000);
property:
Reference: jQuery API Animate
Upvotes: 1