Jump to content


  • Posts

  • Joined

  • Last visited

cemycc's Achievements



  1. I understand now the behavior of edgeResistance. Thank you.
  2. Update for other problem of mine described here http://forums.greensock.com/topic/8248-drag-new-element-from-the-div/#entry31916 . Now with the new functions startDrag and stopDrag I can set the position of the draggable center relative to the mouse position. On the mousedown event for the div i want to clone, I create the new clone and the draggable object then I just call startDrag. Thanks for this again.
  3. Thank you for your answer. I still can't get the same effect like before. What I want is that when the draggable element is dragging outside the bounds he will keep his position outside. Right now when I release the mouse he gets back in his bounds. On older version the element was staying outside the bounds but he was dragging outside the edgeRessistance property was used. Now with liveSnap: true there is no edgeRessistance but still when I release the mouse the element goes back to the bounds.
  4. Hello, 2-3 weeks ago when I had tested the draggable was working like this: I set up bounds to a div and edgeResistance to 0.9. When I was dragging the element outside the bounds it was possible to keep is position outside but with 'slow motion' because of edgeResistance. Now, I have updated the library and when I drag outside bounds It gets back to the bounds. I was looking on documentation and I think that the new method applyBounds() is called automatically on drag end.
  5. Oh, I think you are right. on the startDrag event (mousedown) I just change the width and height and opacity at the same time. I don't know why I haven't think at it. And after I change the width/height I move the element to match his center with the mouse position using set function. When I am home, I will test it. Carl you are right to get the draggable's center to match the mouse position is tricky, the only method I figure it out to get it working is setting the draggable's element to position absolute.
  6. Thank you, yes it is but the problem is that the new element can be smaller or larger and there are other elements near it ( like a list ) so they can overwrite the z-index if they are larger. To fix it I will need to make only the width/height of the base element to be draggable on the new one and after that I can move it to have the mouse pointer on center. I will need something like dragFrom: (0,0) to (x,y) or similar . If there is no solution I will need to make with mousedown(create element append), mousemove(move the element) . Thanks again for your time.
  7. Hello, Thank for your answer and the code. Is not what I want, I have edited the pen so will ilustrate exactly what I want. The problem is that when I press the mouse down the new element need to be dragged again and I want to be dragged from the first time after I press the mouse down. http://codepen.io/anon/pen/uwEKJ
  8. I was trying that now, but I still need to drag again the element. On DragStart I create the new div then I insert the div in dom and I move it at the position that I want and I create a new draggable event on it but to work I need to go over it again and drag it.
  9. Hello, I have a list of divs and when the user want to drag the div I want to create a new div and that div will be draggable. The main div will keep his positions. How can I make this with the Draggable plugin ? I was trying to add a mousedown event on the main div and on that event I create the element and attach the Draggable event but is not working as expected, the user need to redrag that element to work.
  10. Yes, is it working now. I am using the set function. Thanks for the help !
  11. Hello, I move the element that have the dragged event on it with translate3d and I give the coords that I want. After, I click on it to move it again he will go back to the position where he was when drag have stoped. He don't start from the new position where I have moved it. This means that the draggable plugin saves the positions somewhere and he ignore the position from css, how can I change it ?
  12. @rhernando I am trying to build a stage on what you can drag different elements and then you move them on that stage and after you hit play. Then they will start playing from the position where they had been dropped on the stage to the position where the user have finish moving the element. I understand now, from what I have learn today I will use translate to position my elements (they are draggable and before I was using jquery UI library for the drag,drop events but now i will write from scratch with mouse move/down/up). Just need to find a way to corelate the mouse positions and the ones from the dragged div. You where right, I was thinking that x and y are in relation to the first relative parent and the funny thing was that I haven't read about that on internet because was obvious for me to be like that. Also, for some elements I will need to make bigger paths, for example they will have like 150+,200 points. I was thinking to verify the distance between every group of 2 points and if the distance is lower than 2 or 3 to remove the point. It will be better for animation performance ? Also, I forgot to mention that I record the points with a delay of 15 miliseconds. And for canvas performance I bet that will be better to use the points that I get from bezierThrough() function rather than using quadraticCurveTo() function on every group of 2 points like i am doing right now. Thank you again for the help, I am learning new things everyday.
  13. Thank you again for the fast reply. I got some free time and I wrote a codepan. http://codepen.io/anon/pen/tgjlH For the box element you will see that is position at 185,164 but when the animation start he goes down even if the positions on points array are similar The position on points array got generated from mouse moves on my site ( I can't write the entire code because I am using coffescript ) I have wrote only the part with the problem.
  14. Thank you for your reply. @rhernando I still have the same problem, I will write a codepan as soon as I am back home from work. Also, I was thinking and reading some articles on internet, will be better if I have drag the elements with translate css property rather with top left ? Also on the div I will need to rotate it and change is size. Rotation and size will be also animated on the bezier path.
  15. Hello, I have a div that have dimensions 1024x768 and position absolute on it. On that div I have one element with position absolute. When I move the element inside the div I save his position at every move of mouse then with this positions I want to animate the element on the path recorded by mouse positions. Also, when I move the mouse with the element I draw a path on canvas with ctx.quadraticCurveTo function using the points that I save from mouse move. The problem is when i use the bezier plugin with TweenMax the element change the initial position from the canvas path because for animation is used -webkit-transform: matrix(1,0,0,1,560,230). Also, I am using the Bezier plugin with the type cubic because this was the only type that can make almost correct animations. If someone have other sugestions how can I do this ? Because for some paths I save allot of points and maybe there is another method ? I was looking at bezierThrough() function for drawing the path on canvas but I don't know what function I will need to use. Thanks in advance for your help.