Open HugoHeneault opened 9 years ago
Yes please!
Anyone have any success adding a destroy method?
I know it's over two years since this was requested... but this is 100% needed.
I have a logo I want to midnightjs - but only when scroll position reaches a certain point gonna have to hack this functionality in myself :-1:
If you hack it by yourself, don't forget to let a comment here saying what you did. Or better, open a PR :)
@benjamenhogben @HugoHeneault I'd be happy to accept a PR with this feature. I'm guessing the destroy() method only needs to clean up all the bindings (mostly the requestAnimationFrame and resize ones) and roll back the markup changes.
+1
I was looking for a destroy method because I needed to reinit on ajax page change. While it isn't a destroy method, the refresh method did the trick for me, which you can access by doing the following. $('.header').midnight('instance').refresh();
Thought it might be helpful for someone!
Credit to @tkatchenko for figuring this out.
Hello,
Thanks for your great plugin! I'd like to have a method to reset all the midnight's stuff :
could be great. :)