| Page 1 of 1 | [ 6 posts ] |
|
Hello! I'm writing a card game of sorts using YUI as a basis - primarily using Drag and Drop, however my experience with Javascript is fairly limited. The PHP side is ready to go. The user's deck is shown using mySQL/PHP and laid out in a table. However, while I can create individual drag instances.... I'm lost as to how to apply multiple drag instances. Each card - and there could be up to a hundred - needs to be draggable. Any user's individual deck could be anywhere from 20 to 100 cards, so the Javascript ... script.. needs to be intelligent enough to detect that and apply the drag accordingly. There are five drop targets avaliable - these will stay the same and don't have to be dynamically defined. What is the best way to do multiple drag instances in this fashion?
The other issue here is much simpler - Once a card is dragged onto a drop target.. it needs to trigger a related PHP function (all already prepared).... can that be done? These functions don't need to reload the page/etc. |
|
The second part is easy, on drop make an IO request to your page to call the php function.
The first part is a little more complicated & I would need a page with an example. |
|
Basically I'm looking for something shown in the examples but done dynamically, with up to a hundred possible draggable objects:
http://developer.yahoo.com/yui/examples ... roups.html I tried to do it using a class, however that just worked for a single object and ignored the others. |
|
|
|
Thank you! I never would've guessed it was that simple. Kept trying to do it in groups like the examples showed.. which predictably didn't work exactly!
|
|
Okay, that worked. I just need to figure out how to constrain these to a certain area now... items.plug() doesn't seem to want to work
|
| Page 1 of 1 | [ 6 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group