Home › Forums › WoodMart support forum › Collapse Product Details Tab
Collapse Product Details Tab
- This topic has 15 replies, 3 voices, and was last updated 5 years, 3 months ago by Artem Temos.
-
AuthorPosts
-
July 13, 2019 at 1:35 am #132494
[email protected]ParticipantCurrently I have the Details accordion on my product page that is expanded by default on mobile. I would like it to be collapse by default like the other accordions. How would I go about this?
July 13, 2019 at 1:08 pm #132529
Elise NoromitMemberHello,
Please add this code to the Theme Settings > Custom CSS > Mobile/Tablet:
.woodmart-accordion-title { cursor:default; pointer-events: none; } .tabs-layout-tabs .woodmart-tab-wrapper .wc-tab { display: block!important; } .tabs-layout-tabs .woodmart-scroll .woodmart-scroll-content { max-height: 100%!important; }
Best Regards
July 13, 2019 at 5:42 pm #132564
[email protected]ParticipantThat didn’t work. Now all 3 of my tabs are opened by default and they don’t even collapse when I touch them 🙁
It gives me two warnings on lines 7 & 10 “Use of !important”
July 13, 2019 at 6:01 pm #132571
Elise NoromitMemberHello,
Do you want all of them to be always closed? I cannot figure out what is your purpose. I provided the code to have all the tabs open.
Please clarify
Best Regards
July 16, 2019 at 2:43 am #132855
[email protected]ParticipantI would like the tabs on the product page to be closed by default on mobile. The user should click to expand if he wants to read more.
Currently the default is that the first one is opened and the others are closed
July 16, 2019 at 6:44 am #132880
Elise NoromitMemberHello,
Add the snippet to the Custom JS section in Theme Settings:
setTimeout(function() { var $tab = jQuery('.woodmart-tab-wrapper').find('a.active'); $tab.siblings('.wc-tab').hide(); $tab.removeClass('active'); }, 10);
Best Regards
July 18, 2019 at 11:18 pm #133487
[email protected]ParticipantThis did not work. Please see the attached screenshots. As you can see in the current view, the first tab called “Description” is opened and all the content is there. I can close it if I click on it, but I want it to be closed automatically like in the desired screenshot.
The user should click to read more. I don’t want all that expanded by default.
This is only for mobile of course. On desktop I do not have an accordion, they are tabs.Attachments:
You must be logged in to view attached files.July 19, 2019 at 9:24 am #133539
Elise NoromitMemberHello,
You need to add the code to the Theme Settings > Custom JS > on document ready http://prntscr.com/oh7hzb
Remove it from CSS and insert in JS.
Best Regards
July 19, 2019 at 6:50 pm #133667
[email protected]ParticipantAh indeed, that was my mistake.
One more issue though: now the tabs on desktop are closed by default also (see attached). Can we make this code apply to tablet and mobile only?Attachments:
You must be logged in to view attached files.July 20, 2019 at 7:29 am #133693
Artem TemosKeymasterTry to replace the code with the following one
setTimeout(function() { if( $(window).width() > 1024 ) return; var $tab = jQuery('.woodmart-tab-wrapper').find('a.active'); $tab.siblings('.wc-tab').hide(); $tab.removeClass('active'); }, 10);
Regards
July 26, 2019 at 6:34 pm #134631
[email protected]ParticipantThis didn’t work either, back to square one as if there were no JS code. The tab is opened correctly on desktop but the description accordion is also opened.
July 27, 2019 at 10:12 am #134668
Artem TemosKeymasterHello,
Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it? Also, send us a link where you have added the code.
Thank you in advance
July 27, 2019 at 6:50 pm #134722
[email protected]Participantsee private
July 28, 2019 at 10:06 am #134757
Artem TemosKeymasterTry to replace the code with the following one
setTimeout(function() { if( jQuery(window).width() > 1024 ) return; var $tab = jQuery('.woodmart-tab-wrapper').find('a.active'); $tab.siblings('.wc-tab').hide(); $tab.removeClass('active'); }, 10);
July 29, 2019 at 3:52 am #134856
[email protected]ParticipantSuccess! Thank you
July 29, 2019 at 6:03 am #134864
Artem TemosKeymasterGreat, you are welcome!
-
AuthorPosts
The topic ‘Collapse Product Details Tab’ is closed to new replies.
- You must be logged in to create new topics. Login / Register