Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

usheeen

Members
  • Posts

    45
  • Joined

  • Last visited

usheeen's Achievements

Newbie

Newbie (1/14)

6

Reputation

  1. Well thanks for considering Carl. I do just think that Flexbox is with us to stay but maybe Greensock should just wait it out until vendor prefixing has been dropped. Until then, this is a fine solution: $(elem).attr('style', 'display: -webkit-flex; display: flex');
  2. Hey Diaco, this is indeed a solution but I think this should be supported by TweenMax itself.
  3. You're right it is kind of a special case, but a very important one Here are some relevant Stack Overflow solutions: - http://stackoverflow.com/questions/17896846/set-display-property-flex-on-element-cross-browser#answer-17897282 - http://stackoverflow.com/questions/21819801/setting-flexbox-display-with-jquery-for-multiple-browsers/#answer-24706195
  4. Check out this pen: http://codepen.io/oisinlavery/full/LVypKX/ Safari is the only modern browser that requires prefixing: http://caniuse.com/#search=flexbox Of course we can't do multiple prefixes so best case scenario is to include -webkit- and have it work in Chrome and Safari. However this will prevent it from working in the non webkit browsers, it also feels weird adding a vendor prefix to TweenMax config, I expect it to do the hard work
  5. Flexbox is the modern way to lay out an interface, however it still needs vendor prefixes. At the moment I'm using: TweenMax.set(element, { display: "-webkit-flex" }); ... which supports Chrome, Safari and iOS, it would be great to have this work for all browsers by display: "flex". Why don't I just do this in CSS you ask - I have a couple of plugins heavily utilizing Greensock (think carousels, tabs, etc.) that I need to be JS only, so defining the essential structural styles in code is necessary. For me flexbox is the best and cleanest way to layout a carousel or sliding tab content (using Draggable). I imagine the infrastructure is there to accommodate this essential CSS property. It would be a great addition to your CSSPlugin.
  6. I assumed all. Would it be a big deal to add throwUpdate and throwComplete?
  7. Ooops, how did I miss this! Marking solved.
  8. When I thought about it I thought this warranted a separate post / feature request, mostly because Draggable depends on the DOM and a Greensock event bus is a broader and larger feature request. http://greensock.com/forums/topic/11717-feature-request-allow-draggable-to-emit-events/
  9. I've pivoted on this discussion and made a feature request for Draggable events: http://greensock.com/forums/topic/11717-feature-request-allow-draggable-to-emit-events/
  10. This came up in my thread from earlier today and ties into another recent thread about events in TweenMax. I'd like to make a feature request for Draggable to emit events (onPress, onDrag, onThrow, etc.). This feature will allow the decoupling of our code from the create function and encourage good coding practice and organisation. Unlike TweenMax, Draggable is heavily tied to the DOM and so I think this is a reasonable request. At the moment I'm doing this using pub/sub to emit the events from within the Draggable init code. It works but it is an extra step. Here is a good example - the PageModule and the HeaderModule are logically separate pieces of code. The PageModule doesn't know about the HeaderModule, it just emits events. Jack, Carl, what do you think?
  11. Thanks Diaco, evaluating onDrag rather than onDragEnd does the trick. now I can decouple my modules nicely. Original pen updated: http://codepen.io/oisinlavery/pen/LVGOpZ Blake, I feel like Draggable is so tied to the DOM that emitting events should be added. Do you think I should start a new thread or add to the TweenMax events thread?
  12. Thanks for your help so far, updated with your suggestion: http://codepen.io/oisinlavery/pen/vOLWJe Unfortunately, this doesn't seem to fix it, again the snapping doesn't become active until the next drag. My main goal here is to decouple my main Page Draggable from whatever sub modules it might effect. In a way referencing the HeaderModule in the PageModule goes against this. Also, it would be great if Draggable emitted events rather than having to hook up pub/sub myself. Has this ever been considered?
  13. Here is the CodePen as promised: http://codepen.io/oisinlavery/pen/LVGOpZ I'm using PubSubJS to handle events between modules.
  14. So I think I need to flesh out my example a bit more... My dragEnd function is actually being called in a separate module. I'm sending an event from Draggable.onDrag and listening for it in this module. So perhaps the latency here is causing the problem, maybe the event is arriving a little too late for me to update the snapping in time. I will put together a codepen shortly.
  15. Is it possible to set snapping onDragEnd? I've tried... onDragEnd: function(){ if(this.endY < 100){ draggable[0].vars.snap = function(){ return 0; } } } and... onDragEnd: function(){ if(this.endY < 100){ draggable[0].vars.snap = [0]; } } but neither seems to work. I'm guessing this is because the snapping tween is created before this point, any ideas? Note: this is a simplified example, my actual application has has much more logic for evaluating where it should snap. Hence cannot define it when creating the Draggable.
×