Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't initiate Dragdealer with DOM element while parent is hidden #101

Open
onassar opened this issue Sep 20, 2015 · 2 comments
Open

Can't initiate Dragdealer with DOM element while parent is hidden #101

onassar opened this issue Sep 20, 2015 · 2 comments

Comments

@onassar
Copy link

onassar commented Sep 20, 2015

Having trouble initiating a Dragdealer instance, passing in the DOM element itself. The catch is, if I run the code once it's parent container has had it's display: none; style removed, it works.

Here's the code I'm using:

new Dragdealer(el, {
    steps: 65,
    slide: false,
    snap: true,
    animationCallback: function(x, y) {

    }
});

I think if you try the same, ensuring that the parent container is hidden, you'll notice it.

@onassar
Copy link
Author

onassar commented Sep 20, 2015

Oh also worth mentioning is that the DOM element is not yet part of the document tree. I create the Dragdealer instance, and after that, add the element to the document tree.

@ovidiuch
Copy link
Owner

Known limitation. Currently Dragdealer only works on DOM elements attached to a document. Sorry for the inconvenience. Feel free to propose an addition to the documentation page to specify this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants