How can I fully disable FullPage.js under certain conditions?

谁说我不能喝 提交于 2019-12-12 01:47:37

问题


I'm currently using fullPage.js for an information panel. When the user clicks the info button, a fullPage.js overlay appears on top of the rest of the page. The issue I'm having now is that I don't want the fullPage.js functionality to be applied to the rest of page when the info button isn't active.

Is there a way to fully disable all fullPage.js functionality?

Thanks!


回答1:


You can destroy it completely by using the destroy function:

//destroy any plugin event (scrolls, hashchange in the URL...)
$.fn.fullpage.destroy();

//destroy any plugin event and any plugin modification done over your original HTML markup.
$.fn.fullpage.destroy('all');

Just add that function inside your click event for that button, for example.



来源:https://stackoverflow.com/questions/29374656/how-can-i-fully-disable-fullpage-js-under-certain-conditions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!