Requires

Provides

Drag.Limits.js

A set of function to easily cap Drag's limit

License:
MIT-style license.
  1. 19
  2. 20
  3. 21
  4. 22
  5. 23
  6. 24
  7. 25
  8. 26
  9. 27
  10. 28
  11. 29
  12. 30
  13. 31
  14. 32
  15. 33
  16. 34
  17. 35
  18. 36
  19. 37
  20. 38
  21. 39
  22. 40
  23. 41
  24. 42
  25. 43
Drag.implement({ setMaxX: function(x) { var limit = this.options.limit; limit.x[1] = x//Math.max(x, limit.x[1]); limit.x[0] = Math.min(limit.x[0], limit.x[1]); }, setMaxY: function(y) { var limit = this.options.limit; limit.y[1] = y//Math.max(y, limit.y[1]); limit.y[0] = Math.min(limit.y[0], limit.y[1]); }, setMinX: function(x) { var limit = this.options.limit; limit.x[0] = x//Math.min(x, limit.x[0]); limit.x[1] = Math.max(limit.x[1], limit.x[0]); }, setMinY: function(y) { var limit = this.options.limit; limit.y[0] = y//Math.min(y, limit.y[0]); limit.y[1] = Math.max(limit.y[1], limit.y[0]); } });