nickhiebertdev
nickhiebertdev

Reputation: 563

jQuery UI Sortable Portlets Force right or left

Based off this example on jsfiddle, what I have is identical. I'm trying to come up with a way for when you have an empty space on the right and be able to move the left div to the right without being forced back.

I've tried the following css:

$(function() 
    if( $(".portlet").css('left', '165px') ) { 
        $(".portlet").css('left', '51%');
    } else {
      $(".portlet").css('left', '1%');
    }
)};

Just to note that I'm fairly new to jQuery UI.

Upvotes: 0

Views: 114

Answers (1)

Julien Grégoire
Julien Grégoire

Reputation: 17144

One simple way to do this, if it doesn't interfere with the rest of your layout, would be to force the height of your sortable. Like this:

.sortable {
  width: 200px;
  float: left;
  padding-bottom: 100px;
  height: 600px;
}

http://jsfiddle.net/g6urafLf/1/

Upvotes: 1

Related Questions