Now to get the rest of this thing working :)
On Sep 9, 5:21 pm, Rick Waldron <[email protected]> wrote: > Awesome! > Rick > > > > On Wed, Sep 9, 2009 at 6:15 PM, Dean Elzey <[email protected]> wrote: > > Worked perfectly, hack or not :) > > > On Wed, Sep 9, 2009 at 5:11 PM, Rick Waldron <[email protected]>wrote: > > >> this is WAY hackish... > >> >droppableDivs.each(function (_div) { > >> > Droppables.add(_div, { > >> > hoverclass: 'hover', > >> > accept: *_div.split('_')[1]*, > >> > onDrop: DropHandler > >> > }); > >> >}); > > >> ...but it works. And makes me look less absent minded. > > >> On Wed, Sep 9, 2009 at 6:09 PM, Rick Waldron <[email protected]>wrote: > > >>> Response 1: Yeah i totally overlooked that one... whoops. > >>> Response 2: Yes, I did that on purpose, it was a test... yeah... a test. > > >>> I'll let you decide. > > >>> Rick > > >>> On Wed, Sep 9, 2009 at 5:48 PM, Dean Elzey <[email protected]> wrote: > > >>>> Yep, working on that now :) > > >>>> On Wed, Sep 9, 2009 at 4:44 PM, Chris Sansom > >>>> <[email protected]>wrote: > > >>>>> At 14:39 -0400 9/9/09, Rick Waldron wrote: > >>>>> >Since you say your are just learning, I'd like to impart a tip :) > > >>>>> >Instead of... > > >>>>> > Droppables.add('DropDiv_G1', { > >>>>> > hoverclass: 'hover', > >>>>> > accept: 'G1', > >>>>> > onDrop: DropHandler > >>>>> > }); > > >>>>> > Droppables.add('DropDiv_G2', { > >>>>> > hoverclass: 'hover', > >>>>> > accept: 'G2', > >>>>> > onDrop: DropHandler > >>>>> > }); > > >>>>> > Droppables.add('DropDiv_G3', { > >>>>> > hoverclass: 'hover', > >>>>> > accept: 'G3', > >>>>> > onDrop: DropHandler > >>>>> > }); > > >>>>> >try.... > > >>>>> >var droppableDivs = ['DropDiv_G1', 'DropDiv_G2', 'DropDiv_G3']; > > >>>>> >droppableDivs.each(function (_div) { > >>>>> > Droppables.add(_div, { > >>>>> > hoverclass: 'hover', > >>>>> > accept: 'G3', > >>>>> > onDrop: DropHandler > >>>>> > }); > >>>>> >}); > > >>>>> >Cleaner and DRYer :) > > >>>>> ...except that in the original they accepted G1, G2 and G3 in turn, > >>>>> rather than all accepting G3, so you'd have to jump through an extra > >>>>> hoop in your loop. :-) > > >>>>> -- > >>>>> Cheers... Chris > >>>>> Highway 57 Web Development --http://highway57.co.uk/ > > >>>>> My best advice to anyone who wants to raise a happy, > >>>>> mentally healthy child is: Keep him or her as far away > >>>>> from a church as you can. > >>>>> -- Frank Zappa- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
