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

exit method won't unbind css method. #274

Open
wonsuc opened this issue Feb 5, 2017 · 2 comments
Open

exit method won't unbind css method. #274

wonsuc opened this issue Feb 5, 2017 · 2 comments

Comments

@wonsuc
Copy link

wonsuc commented Feb 5, 2017

slidebars

My website is responsible website, so if the screen became wider, i should call 'exit' method as described on Slidebars document.

After I called 'exit' method slidebars throws strange error.
slidebars.js:173 Uncaught Slidebars hasn't been initialized.

I investigated code, and I found the 'css' method is bound to window resize event.

I think 'exit' method should unbind 'css' method.
And also when binding 'css' method to window rezise event, namespace should be uses with it.
I tried to unbind 'css' method with manual way, it is really hard to unbind specific method without namespace via jQuery.

@jonny-harte
Copy link

Hi,

I have a similar issue with "Uncaught Slidebars hasn't been initialized" When I resize the browser. How did you fix this in the end?

@JoryHogeveen
Copy link

@wonsuc @hartey11
Keep in mind that if you trigger exit without having initialized Slidebars it will throw this error.
Might be a good idea to check isActive() first.

if ( slidebarsInstance.isActive() ) {
    slidebarsInstance.exit();
}

And also for initializing:

if ( ! slidebarsInstance.isActive() ) {
    slidebarsInstance.init();
}

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

3 participants