Jump to content
Search Community

apo

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by apo

  1. apo

    Draggable trigger issue

    From my perspective the trigger is always going to be a child of the target. Or at least i can't really think of a functional scenario where the draggable target is a class or an array of elements and the trigger is a single element. Given that you could do something like that Draggable.create = function(targets, vars) { if (typeof(targets) === "string") { targets = TweenLite.selector(targets); } var a = _isArrayLike(targets) ? _flattenArray(targets) : [targets], i = a.length; while (--i > -1) { if(typeof(vars.trigger) === string){ var trigger = a[1].getElementsByClassName(class); vars.trigger = trigger; } a[i] = new Draggable(a[i], vars); } return a; }; Which is exactly what you suggested to do above, since TweenLite.selector is in fact window.$ or the native equivalent. Again thats only my opinion, i just think the trigger will always be a child of the target. Cheers *A
  2. apo

    Draggable trigger issue

    Hi, Thanks for the quick response. i reached that solution too, just didn't feel so elegant. Just for the sake of conversation, i think that in such a case, where you pass a class selector or an array of elements to the draggable create, the trigger concept feels a bit flaky. Yet, i do understand your reasoning. Again, thanks for your time. Cheers
  3. Hi guys, I am working on a drag and sort thing with draggable and i have an issue that i can't find a way around it. Actually it looks like a bug. Items are in an unordered list so they are all identical in terms of child elements and class names. Draggable seems to work find with a class selector. Here's a code pen with just a simple setup. There is no drag trigger. http://codepen.io/ap-o/full/CEHBo But, once i pass a trigger selector everything goes wrong. Try to drag the little black box. http://codepen.io/ap-o/full/qfKtm Thanks in advance for your time *Apo
×
×
  • Create New...