-
AuthorPosts
-
January 14, 2022 at 5:46 pm #1335621
We’re using a before and after slider within a tab section and when trying to move the slider left and right on mobile, the tab section is jumping from tab to tab. We really need to disable the swipe functionality for this please.
- This topic was modified 2 years, 11 months ago by aestheticare. Reason: updated page url
January 17, 2022 at 4:16 pm #1335892Hey,
Thanks for contacting us!
1- Please go to /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/tab_section/ folder and copy tab_section.js file
2- Create a folder named “js” on your child theme and paste tab_section.js file inside it
3- Open tab_section.js file and replace its content with this one – https://pastebin.com/aHKUCdjv
4- Open functions.php file on your child theme and add following code to bottom of the filefunction wp_tab_section_js() { wp_dequeue_script( 'avia-module-tabsection-js', AviaBuilder::$path['pluginUrlRoot'] . 'avia-shortcodes/tab_section/tab_section.js', array( 'avia-shortcodes' ), false, true ); wp_enqueue_script( 'avia-module-tabsection-child-js', get_stylesheet_directory_uri().'/js/tab_section.js', array('jquery'), 2, true ); } add_action( 'wp_print_scripts', 'wp_tab_section_js', 100 );
For future reference, disabled function is called “swipe_to_next_prev” :)
Best regards,
YigitJanuary 17, 2022 at 4:39 pm #1335896Hi Yigit,
I’ve followed the steps however the same problem still seems to persist on mobile.January 18, 2022 at 7:39 am #1335980Hi,
Thank you for the update.
It seems to be working correctly on our end. We provided a screenshot in the private field. You may need to temporarily disable or toggle the Enfold > Performance > File Compression settings and purge the cache in order to load the new script.
Best regards,
IsmaelJanuary 18, 2022 at 11:46 am #1336007Hi, I’ve tried clearing the cache but it still doesn’t work. I’ve checked on two different mobile devices.
January 19, 2022 at 8:19 am #1336131Hi,
Thank you for following up.
Looks like you have enabled the Enfold > Performance > File Compression settings. Please keep it disabled for now, then try to check the page on incognito mode. Make sure to add the modification that @Yigit suggested above. For some reason, the modification is not working when compression is enabled.
Best regards,
IsmaelJanuary 19, 2022 at 10:35 am #1336154Hi, I had already tried it with compression disabled. I had reenabled it to see if that would make a difference – it did not. I have again tried it with compression disabled, it still doesn’t work. Can you please investigate this issue with more urgency as one message a day with no actual fix is getting frustrating.
January 19, 2022 at 2:35 pm #1336201Hey,
Content of tab_section.js was duplicated in your child theme, you might have accidentally pasted the content of the file twice. I edited tab_section.js file, corrected the issue and then commented out following line
content_wrap.avia_swipe_trigger( {prev:'.av_prev_tab_section', next:'.av_next_tab_section'} );
Please flush browser cache and review your website.
Best regards,
YigitJanuary 20, 2022 at 10:41 am #1336320Thanks Yigit, it’s working correctly now.
January 20, 2022 at 11:45 am #1336332Hi,
Great, I’m glad that Yigit could help you out. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardDecember 22, 2022 at 6:35 pm #1377137Hi,
I also want to stop the swiping from one tab section to another so that swiping only triggers the slideshow (on mobile).
I followed the steps above. On the iPad it stopped the tab-swiping but on the mobile phone the swiping from one tab section to another is still active.
Do I have to comment out the line that Ygit mentions above in reply #1336201? If so what number has the line?Thank’s for help.
Best regards,
VeraDecember 24, 2022 at 9:46 pm #1377310January 3, 2023 at 3:37 pm #1377471Hi,
okay that stops the swiping.
The only thing: now the height of the whole tab section is not adaptable anymore. It corresponds to the highest tab.
Can you help me to adjust this?Best regards,
VeraJanuary 4, 2023 at 2:21 am #1377539Hi,
Vera I looked at your page /projekt/groebenschule/ but I don’t know what you mean by the whole tab section is not adaptable, it looked correct in mobile and desktop. Please explan further.
Since this is not your thread anything you post in the Private Content area will not be private and you will not see anything we write in the Private Content area.
I recommend starting a new thread with further details and perhaps screenshots to point out the issue. Thanks for understanding.Best regards,
MikeJanuary 4, 2023 at 12:09 pm #1377570Hi Mike,
thanks for your reply. It’s okay if the content is public.
I try to specify the issue (sorry for sometimes not being clear enough right away due to lack of the right words):
There is an element after the tab section (submenu KULTUR/BILDUNG) and you have to scroll down quiet a while to reach it because the height of the whole tab section area corresponds to the heigth of the content of the tab “TEXT”. In the backend you can choose “Automatische Anpassung an den Inhalt” which I did.With the new js-file from pastebin this seems to be not working anymore.
Best regards,
VeraJanuary 4, 2023 at 1:48 pm #1377578Hi,
Thanks for explaining further, but this is not what I’m seeing, the content in each of the tabs are independent heights, this can easily be seen at mobile screen widths where the sub-menu KULTUR/BILDUNG is always below the content.
For desktop the sub-menu KULTUR/BILDUNG is always at the bottom of the page because of this custom css:.untermenu { top: 94%; width: 100%; position: fixed !important; text-align: center; left: -5px; font-size: 15px !important; text-transform: uppercase; letter-spacing: 1px; color: #222222; }
Notice the top: 94%; and position: fixed !important; this fixes the sub-menu 94% from the top.
Remove this custom css and the sub-menu will be just below the content.Best regards,
MikeJanuary 4, 2023 at 2:08 pm #1377583Hi Mike,
thanks for your reply.
On desktop it works fine. There the client wants to have the submenu stick to the bottom.
On mobile versions the submenu should follow after the tab section. And here you have to scroll now which wasn’t the case before changing the js in order to stop swiping the tab sections.
I achieved this with the code@media only screen and (max-width: 767px) { .untermenu { width:100%; position: relative !important; } }
So: the issue only affects mobile versions. Maybe I forgot to say that? Sorry if I lost the track a bit over the Christmas break.
Best regards,
VeraJanuary 4, 2023 at 6:54 pm #1377644Hi,
Thanks for the feedback, I was not seeing this when I tested and I just realized that it was because I was clicking on the tabs, for some reason if you click on the tabs once the height is readjusted and they all show correctly.
I don’t know why this is but you could use this script in your child theme functions.php to trigger a click on the active tab on your portfolio pages for mobile only, assuming that you are going to use this same layout for multiple portfolio pages:function custom_portfolio_tab_click() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($) { if ($(window).width() < 768) { setTimeout(function(){ $("#top.single-portfolio #av-tab-section-1").find('a.av-active-tab-title').trigger("click"); },300); } else {} }(jQuery)); }); </script> <?php } add_action('wp_footer', 'custom_portfolio_tab_click');
Best regards,
MikeJanuary 5, 2023 at 12:17 pm #1377699Hi Mike,
great, that works.
Thanks a lot for your support!
Best regards,
VeraJanuary 5, 2023 at 12:50 pm #1377701Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Disable swipe on mobile for tab section’ is closed to new replies.