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

Allow disabling re-positioning for stickybox on smaller screens #197

Open
humitos opened this issue May 29, 2024 · 2 comments
Open

Allow disabling re-positioning for stickybox on smaller screens #197

humitos opened this issue May 29, 2024 · 2 comments

Comments

@humitos
Copy link
Member

humitos commented May 29, 2024

I'd like to be able to pass something like data-ea-smaller-screen=false (or something similar) when using data-ea-style=stickybox to avoid the ad to be re-positioned on smaller screens. This will allow us to show the ad only on bigger screen and show no ad on smaller screens.

Would it be possible?

Referece

@davidfischer
Copy link
Contributor

I think this is possible. I just want to keep it explicit and keep the backwards compatibility of it (the existing stickybox is >1300px or it collapses). We could even have data-ea-style="stickybox-force" which doesn't collapse or something like that. I also wouldn't be opposed to something like data-ea-hide-mobile="true" or something like that.

@humitos
Copy link
Member Author

humitos commented May 31, 2024

In Read the Docs, we are only injecting the stickybox ad if the screen is >1300px. Besides, we are adding an resize event that check if the screen size goes <1300px, we mark the ad as display: none so it's not shown at all when it's auto-collapsed by the stickybox ad client's logic.

That said, I don't need this option anymore since I found this workaround that solves our problem for now. However, it could be a good idea to standardize this behavior by passing an argument as we are discussing here. However, I don't think this is a priority for now.

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

2 participants