You can use the snap option with a function for this (and even more
complicated variants),
see the last example in:
test/functional/dragdrop6_test.html
(comes with the script.aculo.us download).
-Thomas
Am 03.02.2006 um 02:45 schrieb Manuele:
> To constraint the movement to a specific area, I added the
> following lines in dragdrop.js
> This will allow you to specify: area: [2,3,100,120]
> to draw a rectangular area where movement is allowed...
> might have very strange side effects, just needed a quick/dirty
> hack. Plus I installed script.aculo.us just 10 minutes ago :)
> Don''t flame pls.
> Manuele
>
>
> line:202 (please note the "," after snap: false)
> snap: false, // false, or xy or [x,y] or function(x,y)
> { return [x,y] }
> area: false // false, or [x,y,offsetX,offsetY]
>
> line:357
>
> var style = this.element.style;
> if (this.options.area) {
> if (p[0] < this.options.area[0]) p[0] = this.options.area[0];
> if (p[0] > this.options.area[0]+this.options.area[2]) p[0] =
> this.options.area[0]+this.options.area[2];
> if (p[1] < this.options.area[1]) p[1] = this.options.area[1];
> if (p[1] > this.options.area[1]+this.options.area[3] ) p[1] =
> this.options.area[1]+this.options.area[3];
> }
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs