- This topic has 9 replies, 4 voices, and was last updated 3 years, 6 months ago by David.
-
AuthorPosts
-
May 10, 2018 at 6:59 am #572351Leon
Hi Tom
Do you have any plan on giving it an option to sticky the woocommerce product tab in GPP? Or do you have a solution for that please?
The sticky navigation will really help with navigation. Like this: https://www.anker.com/products/variant/lc90-flashlight/T1420011
Thank you
LeonMay 10, 2018 at 9:32 am #572552TomLead DeveloperLead DeveloperThat’s a good idea.
For now, you can do this:
.woocommerce div.product .woocommerce-tabs ul.tabs { position: sticky; top: 0; background: #fff; }
May 10, 2018 at 9:39 am #572561DavidStaffCustomer SupportYou will need to add the -web-kit prefixes for Safari =)
.woocommerce div.product .woocommerce-tabs ul.tabs { position: sticky; position: -webkit-sticky; top: 0; background: #fff; }
And the Top position you may need to set to the height of your navigation if you are using sticky nav
May 10, 2018 at 5:45 pm #572869LeonHi Tom and David,
I added that code and it works.
A bit problem: if you are reading half way through the long description and then clicked other tabs, you will be at the bottom position of that tab (have to scroll up for the tab content). This is the live site: https://www.weservicers.com/service/guangzhou-translator-business-assistant, is there a way to make it that when you click a tab, it shows the first line of the tab content?
Also, is there a way to disable sticky nav on some pages (say single product page). I guess there could be a way to do so with conditional tags, but I’m not capable of handing this yet.
Thank you
LeonMay 10, 2018 at 6:28 pm #572884DavidStaffCustomer SupportHi Leon, to make it jump to the top of the container would require another solution. I will have a look to see what else can be done.
You could hide the Sticky Nav on the product pages like so:
.single-product .navigation-stick { display: none; }
Or alternatively you could just set the sticky navigation on scroll up in the customiser
May 10, 2018 at 9:51 pm #572958LeonHi David,
Thanks again. If you’ve found a way, kindly let me know.
Best
LeonOctober 5, 2020 at 6:39 am #1472978DominikHi there,
did somebody found a solution for this?
We do have a similar problem – our WooCommerce Tabs are sticky on mobile…and if you scroll down a long tab and then switch to another tab…it is on the bottom position of that tab.Thanks and best regards,
DominikOctober 5, 2020 at 9:49 am #1473406LeoStaffCustomer SupportI don’t believe so unfortunately.
October 8, 2020 at 4:31 am #1478234nik9Hi there,
But is this code still working?
We do not get this sticky with this CSS here:.woocommerce div.product .woocommerce-tabs ul.tabs { position: sticky; position: -webkit-sticky; top: 0; background: #fff; }
October 8, 2020 at 4:44 am #1478250DavidStaffCustomer SupportHi there,
position: sticky;
will only work if the element it is applied to sits in a Container that is taller than it. -
AuthorPosts
- You must be logged in to reply to this topic.