How to destroy() Optiscroll?
See original GitHub issueFirst, thx 4 your great plugin! Secondly, how can I destroy() it on the jQuery way?
For Example, I initialize it like this:
$(document).ready(function (){
scrollbar();
});
function scrollbar(){
$('.box').optiscroll();
}
And try to destroy it like this (not working):
$(document).ready(function (){
if ($('body').outerWidth() <= 800 ) {
scrollbar.destroy();
}
});
Whats my fail?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Optiscroll/README.md at master · albertogasparin/Optiscroll · GitHub
destroy (). If you want to remove Optiscroll, this method will clean up the class names, unbind all events and remove the scrollbar...
Read more >Optiscroll.js
$('selector').optiscroll(). Try it out: Initialize! Destroy. Don't see any difference? By default Optiscroll does not create custom scrollbars on iOS, ...
Read more >jquery function destroy on scroll event - Stack Overflow
I have build so far a jquery function that stick html element to the top of the page when scrolling but destroy on...
Read more >Optiscroll pointer - JSFiddle - Code Playground
clientW=i,e!==d){if(0===f&&0===g&&!b.body.contains(this.element))return this.destroy(),!1;this.fireCustomEvent("sizechange")}j(this.scrollbars,"update")}} ...
Read more >Optiscroll Tests
Basics: Optiscroll should auto destroy itself (0, 2, 2)Rerun1011 ms. okay; okay. Public APIs: It should scrollTo(value, value, 0) (0, 2, 2)Rerun61 ms....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You have to call destroy on the Optiscroll instance, not on the function that creates it. You can get it by using
data('optiscroll')
on the element that has Optiscroll:Thx again for your great support! Works perfect now.