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

View less button #37

Open
lesterdefreitas opened this issue May 14, 2019 · 3 comments
Open

View less button #37

lesterdefreitas opened this issue May 14, 2019 · 3 comments

Comments

@lesterdefreitas
Copy link

I am not 100% sure how the destroy function works, so please forgive me if this is a but of a silly question, but I want to be able to create a "View less" button that basically removes all of the additional pages that you have made visible with the "View more" button. Ideally the functionality to click "View more" again should still be there after clicking "View less" I suppose.

Anyone got any ideas on how to do this and if it is possible with this solution?

@Cam
Copy link
Member

Cam commented May 21, 2019

@lesterdefreitas interesting idea! You could remove the extra content easily enough, but telling the plugin to add the right content again if the user requests it again wouldn't work unless you modified the getTheHtmlOfTheNextPageWithAnAjaxRequest function.

@Cam Cam added the question label May 21, 2019
@lesterdefreitas
Copy link
Author

@lesterdefreitas interesting idea! You could remove the extra content easily enough, but telling the plugin to add the right content again if the user requests it again wouldn't work unless you modified the getTheHtmlOfTheNextPageWithAnAjaxRequest function.

Ok, good to know! Could you maybe explain how I could add a button that would remove all of the loaded content?

@Cam
Copy link
Member

Cam commented Jun 14, 2019

@lesterdefreitas Something along the lines of adding the remove button dynamically after loading the new page content, then listen for a click event on that button. Once triggered you would use something like removeChild(elementID) or innerHTML = '' to remove that new page content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants