1

I would like to make a li element expand from right to left. I mean, if my element has the following css :

li{
   position:absolute
   left:10%;
   top:40px;
   width:100px;
}

how can I make that element top expand to the left with jquery, so that its top-right won't move, and it will be its left border that will move?

For now, I just have the following jquery, doing the same thing... from left to right:

$('li').animate({width:'+=100'},400);

Thanks in advance for helping!

evuez
  • 3,257
  • 4
  • 29
  • 44

2 Answers2

7

I recommend setting your element's position using top: and right: rather than top: and left: in CSS, so when it grows the right side remains in the same place.

jtbandes
  • 115,675
  • 35
  • 233
  • 266
1

there is a similar query on this that you can find here: jQuery slide left and show

Community
  • 1
  • 1
vynx
  • 1,269
  • 1
  • 12
  • 20