Jump to content
Search Community

Search the Community

Showing results for tags 'drag'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

  1. Hi everybody, I was wondering if it was possible - I'm sure it is actually but I don't know how exactly - to define a drop area in which draggable elements would go. I saw the "trigger" property but I don't know how to use it. For instance : I created 6 labels like so : <div class="move" id="word1">vol</div> <div class="move" id="word2">nuée</div> <div class="move" id="word3">rangée</div> <div class="move" id="word4">bande</div> <div class="move" id="word5">tas</div> <div class="move" id="word6">pile</div> I give them draggable properties : Draggable.create(".move", { cursor: "-webkit-grab", onDragStart:function(){ TweenLite.set(".move",{cursor:"-webkit-grabbing", opacity:0.6}); }, onDragEnd:function(){ TweenLite.set(".move",{opacity:1}); } }); And now, I would like them to be dropped (not everywhere on the page but) only in a drop area like a <span> : <div class="exercice">Un(e) <span class="DropArea">............................</span> de cailloux</div> How can I reach this result ? Thank you for your consideration.
  2. Hello, I am working with a banner that is 970x418. I am trying to create a parallax effect on y-scroll (drag). In order to do this, I assume that: 1) I need to create a "container div" with a "foreground div" and "background div," foreground on top of the background. 2) Set the container itself to scroll/drag and affect both div's together. 3) Change the speed the background div to be a little slower, in order to give the parallax illusion. So far, I haven't found anything that shows me how to work with dragging one item and using the info of that item to affect the positioning of another. I've seen sites that give code libraries like scrollMagic, but they are not easy when it comes to finding out how to do specific things, only what is shown in their examples. Please help.
  3. I have some code that checks conditions in the onDragStart handler. I'd like to be able to cancel the drag if a set of conditions are not met. I had assumed that returning false from handler would do it, but was wrong. Is there any clean way to cancel a drag in this case?
  4. I'm interested in creating a draggable div that can be translated or rotated depending on some criteria, for example: rotate if CTRL is pressed, translate otherwise...or, translate if the mouse is clicked near the center of the object, rotate if the mouse is clicked near the edge of the object. The method I've tested involves detecting the CTRL key up/down events and killing the existing translate/rotation draggable and creating the other one. This works except that after an object that has been rotated, then translating it causes additional rotation. Any suggestions?
  5. Is it possible to ignore all events on a drag container ( type = scroll ) when I drag a nested element ( type = x,y )? When I use dragContainer[0].disable(); the container resets the position to 0,0. I tried to disable interaction with dragContainer during the onDrag event from a nested element, but no success. edit: I've added a pen. So when you drag the yellow container around you will see some images. When I drag those images (nested draggables) you will see that the container is moving as well. When you uncomment #111 & #116 you will see that the disable/enable is making trouble somehow.
  6. I want Drag & Copy use GSAP Draggable solution
  7. Hi, I'd like to replicate a popular scrolling effect in mobile apps these day. When scrolling a list with a header image, overscrolling would cause the header image to grow in relation to your overscroll amount. I listened to the 'onDrag' event, and then query the 'y' property of the Draggable instance. It seems that the reported value does not take overscroll into account. I patched the Draggable source to enable this (detail below), but I am wondering, is there's a proper/native way of doing this? This is my patch to Draggable.js: //pass instance to scroll proxy object so we can dispatch event and append overscroll information 677-ish: ScrollProxy = function(instance, element, vars) { //now when instantiating scrollProxy, pass reference to self 1824-ish: scrollProxy = this.scrollProxy = new ScrollProxy(self, target, ... //line 752-ish right after if (offsetLeft || oldOffset) { .. }, append offset info and dispatch a new overscroll event instance.offsetLeft = offsetLeft; _dispatchEvent(instance,"overscroll","onOverscroll"); //line 785-ish right after if (offsetTop || oldOffset) { ... }, append offset info and dispatch a new overscroll event instance.offsetTop = offsetTop; _dispatchEvent(instance,"overscroll","onOverscroll"); So now in my onOverscroll handler I do something like: var offset = myDraggableInstance[0].offsetTop; var headerScale = 1 + ((offset / 120) * .5); //scale the header up to 1.5x when overscroll is between 0-120px Thanks!
  8. Hello, is it possible to make a ios like drag menu, where I can "throw" the menu open? Maybe with throwProps plugin or so... I don't know, I am new to GSAP I mean something like you can see here: https://www.youtube.com/watch?v=hbuL-vUDBhg&feature=youtu.be&t=32s What I mean happens at 32s I've already tried it out as you can see in the codepen example. Greetings, luneyard
  9. Hello, I was wondering how could I limit a draggable movement only diagonally towards top-left and bottom-right. Thanks guys!
  10. Check out the Codepen and you'll notice that you're able to drag the octopus to the left a bit before the bounds stop you from going further. You can't go to the right at all. After you let go, you'd expect to be able to drag it to the right (back to where it started), but it seems as though the bounds reset based on the image's relative position. When you drag it, you can't go to the right, but you can go further to the left than you originally could. Thanks for your help!
  11. nexie

    drag and emitter...

    Hello, This is what i want to achieve: the user should tap the object, and on drag, the behind object should emit some particles (let's say 25) and after emmision to load another canvas over it. How doable is it? Can you point me in the right direction on what do i need to use? I will add a codepen as soon i get pointed into some direction on what libraries should i use or if you have any examples i can inspire from, even better! Nexie
  12. Hi, I have two questions, i've already some kinds of solutions, but I would to know if you have some ideas about it : first, I would to know if I can easily combine drag and bezier : I mean, drag an object along a bezier curve using drag & bezier plugins? My current idea is to create a timeline with my object animated along the curve, stop this animation, and control the timeline with a simple horyzontal drag in the bounds box of the curve. Do you see what I mean ? Then, I would to be able to draw the curve ( dotted.. but it's another problem ), do you have any ideas of how I can convert my bezier coordinates to use canvas's method quadraticCurveTo() for example ? Let me know if you have any suggestions, advices.. Thanks !
  13. The ThrowPropsPlugin API page contained an example of using it for scrolling a page vertically, and the throw props web page contained an example for doing horizontal panel transitions that animate entire panel movements right and left. Both of these work extremely well. But when I combine them, I run into problems that both of them are acting on mouse up and mouse down events, which means neither is working as intended. Add some interactive objects to the scrolling page, and it only gets more complicated. I think the solution is to write a singleton class that interprets mouse down, mouse move and mouse up events on the stage and infers user intent so that is can dispatch an event to either the scroller, or the panel slider, or the interactive object in the scroller viewport. My past experience with mouse events is limited to listening for clicks. So, if there is any example code that would point me in the right direction, I would be very happy to know about it.
  14. Hi guys, I just tried the ThrowPropsPlugin to move a MovieClip in x-direction instead of y-direction like in the example. I took the code from the example and changed every y-value to an x-value. However, it doesn't seem to work smoothly. The drag-movement is somewhat stuttered. Strangely enough, the drag-movement where the position exceeds the bounds runs smoothly. I've attached a minimal working example, maybe someone can have a look and tell me where the code goes wrong. For some reason I'm not allowed to attach any file, so I'll just upload to my Dropbox: https://dl.dropboxusercontent.com/u/289091/ThrowPropsPluginTest.fla
  15. Here's my dragdrop code: sym.$('card2').draggable({opacity:.5,revert:'invalid'}); sym.$('droptarget2').droppable({ accept:sym.$("card2"), drop: function() { sym.getSymbol("card2").play(); sym.getSymbol("droptarget2").play(); } } ); I want to have 2 different actions happen depending on the filename. ie. if (droppedfilename=="qs.png") { // accept and fade out } else { // don't accept } How do I detect the filename of the dropped image.
  16. Hi All, I have a site where I have a horizontally styles un-ordered list (<ul>), my site dynamically adds items to the list based on user interactions. For each new item in the list, I have applied a Draggable.create call to make them draggable in the Y axis (vertical), I also apply an animation Tween on the item so it bounces into place. This all works fine! Im using this code for that: //add to the UL $(".cardList").prepend(newDiv); //animate the card into place TweenLite.from(newDiv, 0.5, { y: -250, ease: Elastic.easeOut }); Draggable.create(newDiv, { type: "y", onDrag: function () { //my code... }, onDragEnd: function () { //my code... } }); However, when there are a lot of items in the list, I would like to scroll the list horizontally, so I wrapped up my list into a DIV container and called: var scroller = new Draggable("#cardsContainer", { type: "scrollLeft", edgeResistance: 1.0 }); ...which 'kind of' works. I currently have 2 issues: 1) I can add a new item into the list and I can see that the scrollbar on the scroller increases, but from time to time, the scroller "snaps back" prematurely, so effectively you can never scroll to the end of the list. It simply stops scrolling, it looks like the animation I am using to add the new items to the list could have some effect on the calculation of the width of the scroller? 2) When I click and drag the scroller (when it does work), the items in the list which can scroll vertically move slightly up/down, can I have some kind of check to see if the user is scrolling left/right and NOT enable the vertical scroller based on some threshold? I hope that makes sense
  17. Hi there, New to forums in general but here goes. Would it be possible to create a Playerhead or scrubber that followed a pre-set path? For instance could you drag an MC along a curved line that also controlled the playback of an animation instead of a traditional horizontal playhead? Thanks!
  18. I'm working on a project, using the TransformManager, and I need to fiddle with the pixel tolerance, for triggering the drag-function on a line on the bounding rectangle. Is there a function for this, like the: paddingForRotation(value:Number):void ?? I have been over the docs a few times, and can't seem to find a call to do this.
  19. jeff4gee

    Drag and Drop

    I am trying to setup an animation with GSJS that allows to drag one div item over another and fires a function either on over the target object or release of draggable object on top of landing target. Thanks for your help!
×
×
  • Create New...