hi I''m making a chess board app in Rails using the scriptaculous drag and drop stuff. A couple of questions, I am having trouble putting the chess pieces in the correct place - simply it seems that when i make somethign draggable it changes its positioning to relative - not so good for putting pieces on a board. Why is this ? Also i can''t see an OnDrop callback in the API documentation. Is this correct ? cheers jonah
> hi > > I''m making a chess board app in Rails using the scriptaculous drag and drop > stuff. > A couple of questions, I am having trouble putting the chess pieces in the > correct > place - simply it seems that when i make somethign draggable it changes its > positioning > to relative - not so good for putting pieces on a board. Why is this ? > > Also i can''t see an OnDrop callback in the API documentation. Is this > correct ? > > cheers jonahThis is probably silly since I''ve never used the drag/drop stuff, but why not use a table for the chess board? That shouldn''t need any funky positioning. I say this because the other day I saw a functioning ajax event calendar in rails that let me move appointments by dragging them to another day... -- rick http://techno-weenie.net
1) use the inline style attribute for positioning, not external CSS files 2) a onDrop callback on Droppables is available (there is a bug in 1.1beta1 that will require you to include a hoverclass:''x'' option for the callback to work) Thomas Am 28.07.2005 um 14:43 schrieb Jonah Fox:> hi > > I''m making a chess board app in Rails using the scriptaculous drag > and drop stuff. > A couple of questions, I am having trouble putting the chess pieces > in the correct > place - simply it seems that when i make somethign draggable it > changes its positioning > to relative - not so good for putting pieces on a board. Why is > this ? > > Also i can''t see an OnDrop callback in the API documentation. Is > this correct ? > > cheers jonah > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
hi - i am writing a chess game in rails and am using the draggable code (for the pieces) and the droppable (for the sqaures). once a piece is moved - i check its validity with an ajax call and either move it to the square (accurately) or move it back. in this i am simply setting the top and left attrbiutes of the style. however the problem i am getting is that when a drag is started on a piece that has been moved with the ajax code - it moves with respect to its original position . i suspect that i shouldn''t be setting the postion with style.top = XX etc. so the question is - how should i set the position. cheers jonah