0

I've a problem, when I set container element:

position: absolute;
left: 10px;
bottom: 15px;

And initialize draggable, bottom part of the element gets stuck to the border, and it is basically resizing rather than dragging.

http://jsfiddle.net/JVSFS/83/

So what do I do?

3 Answers3

0

jQuery draggable works by modifying the left and top css properties of an object.

Set the top property instead of the bottom. I know it sounds like a cheap trick, but it's the fastest solution I found here.

Bobby5193
  • 1,585
  • 1
  • 13
  • 23
0

It is doing what you told it to do. When you set bottom to be 10px on an absolutely-positioned element, the bottom of that element will stay 15px from the bottom of its parent container.

It might be better in your situation to set the CSS to position:relative using mousedown() in your jQuery.

Alex W
  • 37,233
  • 13
  • 109
  • 109
  • Yes that is obvious, but I thought dragable should be clearing bottom as it is doing left and top. –  Jan 28 '14 at 16:42
0

You might want to go about it by removing

.popup_click {position: absolute left: 10px; bottom: 15px;}

and replacing it with: .popup_click {top: 92%; left: 1%;}

Fiddle

Please note that the percentages are just estimates based on where you had it placed before.

Craighead
  • 519
  • 3
  • 8
  • This is a meh solution, same was suggested by Bobby practically. Problem with this solution is that I've to use negative margins, otherwise dragged element goes outside containment. –  Jan 28 '14 at 16:54