Jump to content
Search Community

Tween after dragging...

mimeartist test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I've got a DIV that is draggable... lets calls it projectBoard1

 

when I drag it, and then try and revert it's position e.g.

 

TweenMax.to('#projectBoard1', projectSpeed, { top: 0, left:15 });

 

it doesn't tween, and the only way I can think of doing it is by using CSS

 

$('#projectBoard1').css({top:0, left:15});

 

Is there something to do with once it's been dragged? or possibly some bounds or something?

 

Sorry I've not been able to post any code, it's a big project, and just wondered if someone had an idea offhand what I should be looking at... thank you

Link to comment
Share on other sites

Draggable by default uses transforms for positioning (type:"x,y"), so to move it about you would use x and y instead of top and left. Or, you could change the type to "left,top". It's difficult to say why it's not tweening without seeing it in context though.

 

When we ask for code/samples, we almost never want to see your actual project. Setting up a codepen with 1 div, enough CSS to give it a shape and color, and a few lines of your Draggable javascript would be plenty to demonstrate this one.

 

See the Pen JpbtL by jamiejefferson (@jamiejefferson) on CodePen

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...