Jump to content
GreenSock

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

Draggable: Clear zIndex after dragging

Recommended Posts

How can I clear z-index from a draggable after releasing it, so that new page elements don't appear beneath the draggable item?

Link to post
Share on other sites

If you want to turn off that feature altogether, just pass in zIndexBoost:false. If you want it to be boosted while dragging but then you want to alter it to something else afterward, you could do so in an onRelease:

Draggable.create("#yourID", {
  onRelease:function() {
    TweenLite.set(this.target, {zIndex:0});
  }
});

 

Or just use raw JS to remove the inline style altogether. Totally up to you. 

 

Enjoy!

  • Like 4
Link to post
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.

×