Jquery slideUp () left

I will create a weekly calendar. When I switch the week, I would like to shift the old week left or right to get new content. Can anybody help me? At the moment, I have no good idea to implement this.

Thank you very much.

+4
source share
3 answers

To move left, for example, instead of .slideUp() you can use .animate() , for example:

 $(".oldweek").animate({ width: 0 }); //or... $(".oldweek").animate({ width: "toggle" }); 
+2
source

You can use jquery ui slide :

 $("#calender").hide("slide", { direction: "left" }, 1000); 

Or, if you do not want to include the JQuery UI, I would suggest doing something like this:

HTML

 <div id="calendar-wrapper"> <div id="calendar"></div> </div> 

CSS

 calendar-wrapper { overflow:hidden; position:relative; } calendar { position:absolute; width:100px; height:100px; top:0; left:-100px; } 

js (jquery)

 //to show $("#calender").animate({"left":"0px"}, 1000); //to hide $("#calender").animate({"left":"-" + $("#calender").width() + "px"}, 1000); 

You can also use classes instead of specifying a left position in js and then animate this.

I also saw people living {"width": "toggle"}, but I find it laggy. try it if you want.

As you can see, there are many solutions for what you need. good luck !!

+2
source

you can use the jQuery Cycle plugin to get the desired result ... if you have jQuery knowledge ...

http://jquery.malsup.com/cycle/

0
source

All Articles