Jump to content
GreenSock

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

ninmorfeo

ShockinglyGreen
  • Posts

    28
  • Joined

  • Last visited

About ninmorfeo

ninmorfeo's Achievements

Newbie

Newbie (1/14)

6

Reputation

  1. italian ...im using traslator
  2. I feel sad ... I can't explain myself ... I wrote it in every answer. Maybe i hope is not the problem with my English, I don't write well ... I don't have to kill the drag of the released object, but that of everyone else: (((((
  3. the demo is present in the first post above. Obviously it's not exactly the project I'm doing, but if I can figure out how to edit the demo at the top I will be able to bring it back to my project as well. As you can see there are a series of squares on which the dragging is attached, it would be enough for you to show me how to eliminate the draggin g from all objects after you have placed a square in the dropping area. Exactly as it is reported in the codepen js code that I posted, instead of the Draggable.get (". Box"). Kill () line; instead there should be the function that allows me to kill all the drag
  4. I thought there was a more immediate method ... I have a deck of 40 cards, the user chooses 10 cards using drag and drop, after which I have to make sure that the dragging function is no longer attached to the remaining cards. So to solve I have to create an array with 40 cards, eliminate the selected cards from the array and only end up cycling on the cards left in the array and use the kill command on each instance? a bit hateful .... If there is no other way I think that in the future a solution should be implemented in the draggable class, because all the other libraries I used have a method to eliminate dragging, in some libraries it was enough for me to simply delete the class from the objects, for example if a div had the class "drag", it was enough that I eliminated such class through jquery
  5. hi thanks for answare but i don t want kill single istance....but all ones
  6. it seems that it doesn't work, i wish to kill all drag instance ... Draggable.create(".drag_item", { bounds: $('.drag_zone'), edgeResistance: 0.9, type: "x,y", throwProps: true, throwResistance: 2000, maxDuration: 0.2, onRelease: function () { if (this.hitTest('#dropzone')) { Draggable.get(".drag_item").kill(); } else { tmax.to(this.target, 0.1, { rotationX: 20, scaleX: 0.6, scaleY: 0.6, boxShadow: "-2px 2px 5px 0px rgba(0,0,0,0.75)" }); } } });
  7. thank you very much, if I don't ask for too much I could know what exactly this istruction does? index% 2
  8. mmm in the example you posted I see that only 2 are moving, if I wanted others to move too?
  9. Obviously the code is wrong not knowing how to proceed. My intent is to make sure that in the last stagger, the squares move by -40 pixels from the current x to the left ones and +40 px to the right ones. Currently, they move to the absolute x position of 40
  10. What is the correct syntax for returning to the function the x increment of 40px instead of the absolute position? in the example below, the "+ =" and the "- =" are not read and the objects move to x = 40 .staggerTo(chi, 0.5, { cycle: { rotationY: ["-=20","+=20"], x: function () { var xpos=["-=40","+=40"]; /* xpos="+="+xpos*/ return xpos } }, rotationX: 0, ease: Power4.easeOut }, 0) thanks
  11. it work great! function init_x_pos() { var valore = []; var new_x = 150; for (i = 0; i <= n_carte_totali; i++) { new_x += 35; valore.push(new_x) } return valore; } var a_c_f = new TimelineMax(); a_c_f.staggerFromTo(chi, 1, { cycle: { x: init_x_pos() }, y: 250, rotationX: 10, rotationY: 0, rotationZ: 0, scale: 1, opacity: 0, boxShadow: ' -20px 20px 15px 0px rgba(0,0,0,0.1)', ease: Elastic.easeOut.config(1.1, 0.6) }, { cycle: { x: init_x_pos() }, y: 140, rotationX: 10, rotationY: 0, rotationZ: 0, scale: 0.7, boxShadow: ' -20px 20px 15px 0px rgba(0,0,0,0.1)', opacity: 1, ease: Elastic.easeOut.config(1.1, 0.6) }, 0.3)
  12. the upadate method of the variables I used in tweenMax.to does not seem to work well with the stagger method, perhaps because it is called only once and therefore does not have a control index (it would seem). In fact, if I try to use console.log in the following function for the X property, it always returns the value 0. Unable to rely on index, is there another way to calculate different X values for each iterated object? var a_c_f = new TimelineMax(); a_c_f.staggerFromTo(chi, 1, { x: function (index, target) { console.log(index) new_x=200+((index+1)*35); return new_x }, y: 250, rotationX: 10, rotationY: 0, rotationZ: 0, scale:1, opacity: 0, boxShadow: ' -20px 20px 15px 0px rgba(0,0,0,0.1)', ease: Elastic.easeOut.config(1.1, 0.6) }, { x: function (index, target) { new_x=200+((index+1)*35); return new_x }, y: 140, rotationX: 10, rotationY: 0, rotationZ: 0, scale:0.7, boxShadow: ' -20px 20px 15px 0px rgba(0,0,0,0.1)', opacity: 1, ease: Elastic.easeOut.config(1.1, 0.6) }, 0.3)
  13. it was exactly what I was looking for(function based value) ... sometimes clues are enough for me: P next time I'll try to use codepen thanks a lot for now
×