-
AuthorPosts
-
July 20, 2019 at 10:01 pm #1120490
My client has a site where we use tabs on the left hand side which works perfect. However we also link to tabs using the main menu with drop down sub menus. We use custom links for the sub menu items to link to the various tabs within each department.
For example: See Private ContentThe problem is when we use the links to the tabs from the sub menu items the page/tab section scrolls up a little, causing users to have to scroll down to see content at the top of the page. This causes some confusion for some users and some annoyance.
Please let me know if you can think of anyway to resolve this issue. Thank You !
This is a private website , see login credentials below in Private Content section.
July 22, 2019 at 1:43 pm #1120842Hey webworm72,
Thank you for using Enfold.
That is the default behaviour of opening a tab content — it makes certain that the tab title is visible in the viewport. It doesn’t really help in your case because of how the tab element is used in the page. If you want to change that behaviour, edit the config-templatebuilder > aviashortcodes > tabs > tabs.js file. Look for this code around line 144 and remove it.
if(win.scrollTop() > el_offset) { $(‘html:not(:animated),body:not(:animated)’).scrollTop(scoll_target); }
Toggle the File Compression afterwards if it’s enabled.
Best regards,
IsmaelJuly 22, 2019 at 9:23 pm #1121010Thanks Ismael for the response !
So modifying the theme code is a bit new to me. I have a Child theme as well. I would greatly appreciate if you could please give me a few more details on where and how I would make these changes. For example where is the this file located , am I am making changes via FTP or directly within in WP dashboard ?
- This reply was modified 5 years, 3 months ago by webworm72.
July 24, 2019 at 5:35 am #1121376Hi,
Thank you for the update.
You have to edit the files via FTP. The tabs.js file is located in wp-content > themes > enfold > config-templatebuilder > aviashortcodes > tabs folder. And if you want to override the shortcodes from your child theme, please follow this short tutorial.
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb
Add that snippet in the functions.php file, then create a new folder called “shortcodes” inside the child theme directory. You can override any shortcodes by creating a copy of the parent shortcode files (config-templatebuilder > aviashortcodes) inside the child theme’s “shortcodes” folder.
In your case, look for the tabs folder, copy it and move it inside the child theme’s shortcodes folder. Edit the tabs.php file, look for this code around line 75 of the extra_assets function:
//load css wp_enqueue_style( 'avia-module-tabs' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/tabs/tabs.css' , array('avia-layout'), false ); //load js wp_enqueue_script( 'avia-module-tabs' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/tabs/tabs.js' , array('avia-shortcodes'), false, TRUE );
Replace it with:
//load css wp_enqueue_style( 'avia-module-tabs' , get_stylesheet_directory_uri() . '/shortcodes/tabs/tabs.css' , array('avia-layout'), false ); //load js wp_enqueue_script( 'avia-module-tabs' , get_stylesheet_directory_uri() . '/shortcodes/tabs/tabs.js' , array('avia-shortcodes'), false, TRUE );
You can then modify the tabs.js file in the child theme.
Best regards,
IsmaelJuly 25, 2019 at 9:52 am #1121859Thanks Ismael for the directions !
To keep it simple I did not worry about the the child theme , I modified the tabs.js file in the core theme folder as you described in your first post and it made no difference. See what i did below to make sure I did it right and did not miss anything.
Below in Private content is the original tabs.js file from this install before it was modified.
Below is what i removed from file below in private content . I then uploaded the modified tabs.js file via FTP , cleared the browser cache and cleared the page cache, and still no change in behavior.
if(win.scrollTop() > el_offset)
{
$(‘html:not(:animated),body:not(:animated)’).scrollTop(scoll_target);
}July 26, 2019 at 3:58 am #1122035Hi,
Thank you for the update.
Did you toggle the Performance > File Compression settings after the modification? The changes will not take affect until the scripts are regenerated.
Best regards,
IsmaelJuly 26, 2019 at 8:40 pm #1122210Hi Ismael
not sure what you mean by toggle, i “enabled” Javascript file merging and compression and clicked “Save all changes”
and then modified the .js file and uploaded via FTPunder the Performance section , I have it set for
Javascript file merging and compression
Enable – merge and compress all theme javascript filesCSS file merging is disabled
the way i modified the tabs.js script was as follows via FTP
downloaded file to desktop , opened in wordpad, removed the section of script you said to
saved, and uploaded overwriting the original filesince it did not make any difference I uploaded the original file back in place for now
July 29, 2019 at 7:07 am #1122648Hi,
By “toggle”, I mean disabling and reenabling the compression right after doing the modification, not before. Do the modification, toggle the performance options to regenerate the scripts including the recent changes and toggle the compression back. Or just disable it completely during testing.
Best regards,
IsmaelJuly 29, 2019 at 10:24 pm #1122967thanks Ismael , That’s what I thought you probably meant , I just tried again , still no difference in the behavior of the tab content area using the drop down menus. I left the modified tabs.js file live any way.
I’m still don’t understand why linking to the tab content using the main menu creates this issue you still end up at the same place
https://intranet.martinharris.vegas/operations/#tab-id-1Is there any other workaround you think of ?
July 31, 2019 at 7:01 am #1123401Hi,
Thanks for the update.
Can we have access to the file server? And please set the WP account’s user role to admin. We would like to test the modification.
Best regards,
IsmaelJuly 31, 2019 at 8:53 pm #1123648Hi Ismael , thank you .
Yes the login credentials to the FTP and WP Admin are in the Private section below.
I also included below all of the CSS Snippets being used on the site under the “General Styling” section just so you have that information.August 1, 2019 at 11:21 am #1123854Hi,
The password is incorrect. Can you edit it a bit? Please remove the comma at the very start.
Status: Check your login credentials. The entered password starts or ends with a space character.
Thank you for the update.
Best regards,
IsmaelAugust 1, 2019 at 8:15 pm #1123972HI Ismael
Ok I reset both passwords see below in Private Section
- This reply was modified 5 years, 3 months ago by webworm72.
August 5, 2019 at 4:20 am #1124625Hi,
Thank you for the update.
We disabled the default scroll_top method and set it to scroll to the top after clicking the tab anchor.
setTimeout(function(){ window.scrollTo(0, 0); }, 0);
Best regards,
IsmaelAugust 7, 2019 at 2:13 am #1125337Hi Ismael !
Thank you very much for this solution, you are very helpful.I did some testing of the behavior, I opened Chrome up and went in and Cleared Browser Cache for All Time.
That way I now that there is nothing cached in there to effect behavior.From what I can tell it works like we want except for the first tab in each drop down menu, still scrolls to top , all the rest seem to work correctly
*So only 4 tabs still effected from what I can tell.
Accounting
* Forms
Information Technology
*IT Tools
Operations
* Building Departments
Procurement
* Business DevelopmentLet me know if this matches the behavior on your end and if there is any tweaks we can do or suggestions to resolve it.
Other than that it is much better and I greatly appreciate your help.August 7, 2019 at 11:20 am #1125460Hi,
Glad it worked.
Yes, we can see the issue. Please look for this line on the same file.
window.scrollTo(0, container.offset().top - 70);
Replace it with:
window.scrollTo(0, 0);
Best regards,
IsmaelAugust 9, 2019 at 2:06 am #1126084Hi Ismael !
That did it , it’s working good now. You can close this ticket
Again thank you very much for the assist on this one, it really is nice to have such a fantastic support team like you guys.
If there is a place I can leave a glowing review let me know.Thanks
TonyAugust 9, 2019 at 11:21 am #1126175Hi Tony,
Great, I’m glad that Ismael could help you out and thanks for the kind feedback :-)
You can leave a review on the Themeforest page if you like: https://themeforest.net/item/enfold-responsive-multipurpose-theme/4519990.
I’ll close this thread for now then, please open a new thread if you should have any further questions or problems.
Best regards,
Rikard -
AuthorPosts
- The topic ‘tab links scroll upward’ is closed to new replies.