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

Implement the "destroy" #6

Open
MarcoMoreira opened this issue Aug 7, 2013 · 2 comments
Open

Implement the "destroy" #6

MarcoMoreira opened this issue Aug 7, 2013 · 2 comments

Comments

@MarcoMoreira
Copy link

I just have 3 tabs with ajax providing the content. I call gridNav when one of this tabs is clicked (with fading out the old content and fading in the new one).
When the another two is clicked, that's ok. But when I click on the first one again, the gridNav is misconfigured (all columns occupying the first position).
I think this is because the gridNav doesn't have a "destroy".

So... that's it:
When I click on the tabs, I need to call gridNav again after the fadeIn(). But when I click on another tab, I think I need to "destroy" after the fadeOut()... So, stop the plugin and start again only when I click on another tab, getting the content on the server and, then, fading in that content.

This will be useful for dynamic/ajax contents.

gridnav-destroy
.

@douglasmiranda
Copy link
Member

I see, so this is happening because you are calling gridNav on a list that is already over the gridnav effects. I think you'll be able to fix this by checking if your "gridnav container" is already on gridnav effects. Anyway I'll look into it. Thanks for reporting. :)

@MarcoMoreira
Copy link
Author

If I do this, there's still a problem. As I told, I'm using fadeOut. FadeOut and slideOut makes the

(parent of the gridNav) disappear with "display:none" after the animation (jquery default behaviour). Then, gridNav tries to continues all the animation but don't catch the elements anymore because of this "display:none". When the tab is clicked again, nothing happens. The parent
with "display:block" is just visually empty.

There's a working around... not so good...
Instead of using the FadeOut or SlideOut, just animate the opacity of the parent

. It's not so good because:

  1. There's 3 active gridNav doing all that animations. This makes everything else on the page slower (only Chrome is ok).
  2. Browsers rendering different and broke some things... I think the reason is my css. But to make 3 parents
    of the 3 active gridNav be in the same position, some tweaks like "position:absolute" and "visibility:hidden" is needed. It's going to be necessary some code for each browser to fix it, leaving the code not so clean.
  3. The buttons next and prev need to be on the top of the active gridNav too. Otherwise, the next/prev that the user clicks doesn't controls the visible gridNav.

Well...that's it... I'm still trying some things with gridNav here but I'm not so good with jquery plugin programming... I'm just a designer... =/
But I know that Jquery core couldn't destroy the plugin, it has to be a option of the plugin...

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