Tagged: Fixed Header, mobile view
-
AuthorPosts
-
October 13, 2021 at 3:33 pm #1324773
Hello,
I have a question about the Tabcontainers (DE: “Reiter”). Everything works well, desktop view is pretty good, but in the mobile view I have a problem.
Everytime I click around the tabs (on mobile), the position is not correct. I think this is, because I made the Header in a fixed position on mobile (no scroll, no down-scale.Do you think there is a posibility to give the scroll-offset another, higher value?
October 17, 2021 at 4:36 pm #1325312Hey ronellenfitsch,
Thank you for your patience and the link to your site, I believe that if you edit the file at\enfold\config-templatebuilder\avia-shortcodes\tabs\tabs.js
and on line 129 look for:
scoll_target = el_offset - 50 - parseInt($('html').css('margin-top'),10);
and change the 50 to 180 like this:
scoll_target = el_offset - 180 - parseInt($('html').css('margin-top'),10);
Then clear your browser cache and any cache plugin a few times, and then check.Best regards,
MikeOctober 19, 2021 at 11:19 am #1325546Hey Mike!
I did your changes and everything works fine! Thank you a lot!
I tried to do it in the child-theme with the same folder-structure, but this is not working I guess, but It isn’t tragic.
October 19, 2021 at 12:54 pm #1325565Hi,
Glad to hear this helped, if you are using the child theme that came with the theme then you should see this near the top of the functions.php:function avia_include_shortcode_template( $paths ) { if( ! is_array( $paths ) ) { $paths = array(); } $template_url = get_stylesheet_directory(); array_unshift( $paths, $template_url . '/shortcodes/' ); return $paths; } add_filter( 'avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1 );
then when you copy the tab sortcode folder from
\wp-content\themes\enfold\config-templatebuilder\avia-shortcodes\tabs\
you should put it in the/shortcodes/
directory in your child theme, like this\wp-content\themes\enfold-child\shortcodes\tabs\
ok so now please try adding this function to your child theme functions.php:function wp_change_aviatabjs() { wp_dequeue_script( 'avia-module-tabs' ); wp_enqueue_script( 'avia-module-tabs-child', get_stylesheet_directory_uri().'/shortcodes/tabs/tabs.js', array('jquery'), 2, true ); } add_action( 'wp_print_scripts', 'wp_change_aviatabjs', 100 );
Then clear your browser cache and any cache plugin, a couple on times, and check.
Best regards,
MikeOctober 19, 2021 at 2:05 pm #1325572Hey Mike!
Thank you again! My original functions.php from Enfold child-theme was empty (only Add your own functions here.), so I can’t find your first Code in here. In the functions.php of parent enfold I can’t find it also. Do I need this?
Your other advice sounds legit, I will try It.
- This reply was modified 3 years, 1 month ago by ronellenfitsch.
October 20, 2021 at 12:55 pm #1325721Hi,
I linked the child theme that should have been included with the latest version, in the full theme and docs download from Theme Forest, you can replace yours with this or copy the function I mentioned above to yours.
It is key that you create a/shortcodes/
directory in your child theme to place your modified shortcode directory, like I described above.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.