- This topic has 7 replies, 3 voices, and was last updated 2 years, 7 months ago by
David.
-
AuthorPosts
-
September 30, 2020 at 9:10 am #1465625
nik9
Hello
On Desktop I use the left-sidebar to place the product filters in it. Now I want to define this left-sidebar as floating sticky sidebar. I now that there are some Plugins available wo can handle this. But I want to avoid to install a plugin just for that basic case. Is there a option in GP to made such a floating sticky left-Sidebar for product archive page?
Thanks!
N.September 30, 2020 at 1:08 pm #1465971Elvin
StaffCustomer SupportHi,
You can try Leo’s solution here:
https://generatepress.com/forums/topic/need-help-making-left-sidebar-sticky/page/2/#post-1425851Let us know if it works for you.:)
September 30, 2020 at 11:01 pm #1466487nik9
Hi Elvin,
Thanks. I already tried this CSS here but this is not working on mysite. As I checked, the CSS classes are the same but not working at all. 🙁
.site-content { display: flex; } .site-content > div { left: unset !important; } #left-sidebar { order: -1; } #left-sidebar .inside-left-sidebar { position: -webkit-sticky; position: sticky; top: 80px; }
October 1, 2020 at 3:51 am #1466860David
StaffCustomer SupportHi there,
The CSS sticky property won’t work when the parent container has overflow hidden.
The GP Off canvas and the OCS panel both require thisTry adding this CSS:
@media(min-width: 769px) { html, body { overflow: initial !important; overflow-y: initial !important; overflow-x: initial !important; } }
This will remove overflow hidden on larger screens – so won’t apply when the Off Canvas requires. It shouldn’t affect the OCS CSS either as that is more specific and only applied when the panel is present.
October 1, 2020 at 6:41 am #1467124nik9
Hello Guys
Cool. This is working now.
But I noticed a other issue now. There are a lot of filter in the sidebar. And sometimes (when all values are displayed) its not possible to scroll in the filter or let’s say in the sidebar area. How can we activate the sidebar scroll? When the mouse is in the product section, only this section should scroll and when the mouse pointer is on the side-bar area, only this section should scroll?
Current CSS:
@media(min-width: 769px) { html, body { overflow: initial !important; overflow-y: initial !important; overflow-x: initial !important; } } .site-content { display: flex; } .site-content > div { left: unset !important; } #left-sidebar { order: -1 } #left-sidebar .inside-left-sidebar { position: -webkit-sticky; position: sticky; top: 125px; }
October 1, 2020 at 7:50 am #1467430David
StaffCustomer SupportNot sure but you could try this CSS instead:
@media(min-width: 769px) { html, body { overflow: initial !important; overflow-y: initial !important; overflow-x: initial !important; } .site-content { display: flex; } .site-content>div { left: unset !important; } #left-sidebar { order: -1; position: -webkit-sticky; position: sticky; top: 125px; max-height: calc(100vh - 125px); overflow: auto; } }
October 1, 2020 at 10:54 am #1467798nik9
Hi david,
Great! It work very good now. And i’m also add come CSS to stly the scroll bar a little bit. It look nice!
Thanks!!
October 1, 2020 at 1:05 pm #1467990David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.