Jump to content
Search Community

Joe Hakooz

Members
  • Posts

    51
  • Joined

  • Last visited

Recent Profile Visitors

4,044 profile views

Joe Hakooz's Achievements

6

Reputation

  1. Pradeep sent me this private message. Moving it here in the forum... I think you need to look at the dragClickables option. dragClickables : Boolean - By default, Draggable will ignore clicks on <a>, <input> <select>,<button>, and <textarea> elements (as well as any element that has a data-clickable="true"attribute), allowing the browser's default behavior (like clicking on an input would give it focus and drop the cursor there to begin typing), but if you want Draggable to hijack those clicks and initiate dragging instead, set dragClickables:true. http://greensock.com/docs/#/HTML5/GSAP/Utils/Draggable/Draggable/ ---------------- Hi, When i apply draggable event on a anchor tag it does not nork for me. eg:- <div>text</div>-- it work for me but when i add anchor tag on text <div><a href="#">text</a></div>-- it not work for me Here you can add anchor tag around the .dragclone div, then it does not work. Thank You in advance. Please help ~Pradeep ----------------------
  2. Interesting. Works great in your demo but in my actual project, throwing now gives a funky rubber band feel. My actual implementation is more complex than a single ball. I'm using a bunch of "cards" that dynamically move around to create infinite scrolling. I'll need to play around a bit on my end and see what I get. Thanks for your help!
  3. Spoke too soon. Looks like there's a possible bug. Using your codepen, throw the ball. Then click on the ball without dragging. Notice how it is returning true for each of the properties. Eventually it stops doing that, but I'm not sure how, when, or why. Is this a bug? The reason it matters is because I'm trying to allow a "mouseup" event ONLY when the draggable is not dragging or throwing. Thoughts?
  4. Yep. Updated to latest version and it works. Thanks!
  5. Hello, I'm trying to detect if my draggable "isThrowing"... https://greensock.com/docs/#/HTML5/GSAP/Utils/Draggable/isThrowing/ Clearly I'm doing it wrong? Thanks!
  6. Thanks Diaco! Very clever trick. Do you see any performance hit with using D[0].x over this.x ? I ask because my updateDraggable is doing some fairly heavy lifting and I'd love to keep it as optimized as possible.
  7. I've got a draggable that uses the onDrag event. Is it possible to "trigger" the onDrag event from another DOM element? I can do it but inside the event this.x returns NaN. I think onDragScope might be helpful but not sure how. For example... var draggables = Draggable.create(mydraggable, {type: "x", onDrag: updateDraggable }); function updateDraggable(){ console.log(this.x) // should show a number. Doesn't work when triggered by my button. } $('#mybutton').click(function(){ updateDraggable(draggables[0]); // yeah I know, lame attempt by using a parameter. }); Thanks for any suggestions!
  8. Thanks Carl. That demo will definitely come in handy! My new issue in another post is performing a hitTest on multiple elements. http://greensock.com/forums/topic/11870-draggable-hittest-multiple-elements/ Once I get that resolved I can forget about jQueryUI's less buttery draggable
  9. I'm surprised I couldn't find more on this. Perhaps my lack of searching skillz ? It appears that using Draggable and hitTest() only tests against a single test object. I tried using a jQuery selector (containing multiple elements) but only the first element is "tested"... Draggable.create($('.dragElement), { onDrag: function () { // dragging if(this.hitTest($('.dropElements'), 10)){ // Problem. This should be testing against more than one element. // over one of the drop zones console.log('hit'); } } }); And if this is possible, how can I know which element was "hit"? Thanks!
  10. Thanks Diaco... again! For the record, onDragStart's this.x and this.y include the minimumMovement pixels. So instead of reverting to 0,0 it might return to 9,3 depending on how fast you dragged the element. Instead of onStartDrag I used onPress which gives me the desired pixels BEFORE minimumMovement kicks in.
  11. Hello, I was wondering if Draggable has a built in way to revert back to its original position on release? For example, if I drag an item and it fails a hitTest on drop, then tween back to the starting point. Just like jQueryUI's draggable. If that functionality is not built in I will probably just keep track of the x,y on drag start and send it home if it fails the hit test on drag end, unless someone has a better idea... Thanks!
  12. Now there are a few good options. Some to get the job done quick (for the memory paranoid) and Diaco's for a more robust solution which attaches TimelineMax instances to each slide. Thanks guys!
  13. I found a solution but it doesn't seem like the most elegant. Please let me know if there is a better way. Again, when killing and re-adding a TimelineMax instance mid animation, things get out of whack. To resolve this I simply seek to the end of the animation just before killing it. Seems to do the trick. tl.seek('-=0'); tl.kill(); I left the Codepen "broken" so people can see what I mean.
  14. Okay... Here is my Codepen. Notice if you click the buttons one at a time and wait for the animations to finish it works. However, if you click between the buttons a few times it breaks the animation. http://codepen.io/jhakooz/pen/BNRoBv
×
×
  • Create New...