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

Add an async update function? #50

Open
amcavinue opened this issue Oct 18, 2015 · 0 comments
Open

Add an async update function? #50

amcavinue opened this issue Oct 18, 2015 · 0 comments

Comments

@amcavinue
Copy link

Does anyone have thoughts on being able to call gridly to update asynchronously?
See my video here:
https://www.youtube.com/watch?v=1DHcT4hNp4I

I'm using Gridly for the cards, but when the card opens I'd like to asynchronously call the update using the step method of jQuery's .slideDown (found here: http://api.jquery.com/slidedown/#slideDown-options ). See the code below for an illustration of this.

See how the card slides down, and then gridly updates the dom? I'd like to do that asynchronously. The step function would be called after jQuery calculates its element's position, and then Gridly would have to calculate where all its elements go just then. I already tried this with the way that Gridly is implemented now, but it did not work.

I'm motivated to implement this myself, but it would be appreciated if anyone can give me an idea of where to start in the code (like a description of how the element's positions are calculated). And if anyone has any ideas of exactly how to implement this it would be appreciated.

Here's sample code for how I'm updating the dom:

$.fn.expand = function($listItem) {
    var $subAccordion = $listItem.next('.list-item');
        $subAccordion.slideDown({
            duration: 350,
            queue: false,
            step: function() {
                $('.gridly').gridly();
            }
        });
};
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

1 participant