Skip to content

Commit

Permalink
feat(draggable): method to set drag limits dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
vieron committed Nov 18, 2013
1 parent e3ec796 commit d4482ec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/jquery.draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@
};


fn.set_limits = function(container_width) {
container_width || (container_width = this.$container.width());
this.player_max_left = (container_width - this.player_width +
- this.options.offset_left);

this.options.container_width = container_width;

return this;
};


fn.scroll_in = function(axis, data) {
var dir_prop = dir_map[axis];

Expand Down

0 comments on commit d4482ec

Please sign in to comment.