Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #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 Content

    The 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.

    #1120842

    Hey 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,
    Ismael

    #1121010

    Thanks 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.
    #1121376

    Hi,

    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,
    Ismael

    #1121859

    Thanks 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);
    }

    #1122035

    Hi,

    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,
    Ismael

    #1122210

    Hi 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 FTP

    under the Performance section , I have it set for
    Javascript file merging and compression
    Enable – merge and compress all theme javascript files

    CSS 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 file

    since it did not make any difference I uploaded the original file back in place for now

    #1122648

    Hi,

    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,
    Ismael

    #1122967

    thanks 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-1

    Is there any other workaround you think of ?

    #1123401

    Hi,

    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,
    Ismael

    #1123648

    Hi 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.

    #1123854

    Hi,

    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,
    Ismael

    #1123972

    HI Ismael

    Ok I reset both passwords see below in Private Section

    • This reply was modified 5 years, 3 months ago by webworm72.
    #1124625

    Hi,

    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,
    Ismael

    #1125337

    Hi 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 Development

    Let 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.

    #1125460

    Hi,

    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,
    Ismael

    #1126084

    Hi 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
    Tony

    #1126175

    Hi 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

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘tab links scroll upward’ is closed to new replies.