• Resolved magic22

    (@magic22)


    Hello,

    Can you help me please with offset for mobile? On desktop si good but not on mobile.

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author malihu

    (@malihu)

    Hello,

    The smooth scrolling you see on mobile happens via your theme (script: ...themes/Divi/js/scripts.min.js) which doesn’t have a specific offset (that’s why it doesn’t seem to work on mobile).

    Try adding the class et_smooth_scroll_disabled on your menu link items (enable “CSS Classes” optional field in menu editor) and let me know so I can check it again.

    Plugin Author malihu

    (@malihu)

    You might also need to add this PHP code in your theme/child-theme functions.php:

    function ps2id_custom_script(){
    	wp_register_script( 'ps2id-custom-script', '', array('jquery'), '', true );
    	wp_enqueue_script( 'ps2id-custom-script' );
    	wp_add_inline_script( 'ps2id-custom-script', '(function($){
    		$(function(){
    			$("#et_mobile_nav_menu").addClass("et_smooth_scroll_disabled");
    		});
    	})(jQuery);');
    }
    add_action( 'wp_enqueue_scripts', 'ps2id_custom_script' );

    Let me know

    Thread Starter magic22

    (@magic22)

    Thank you very much. PHP code work well.

    I have another problem with highlight on mobile.
    I put this CSS but don’t work well. On the second web work. I dont’t know why.

    @media screen and (max-width: 979px) {
    a.mPS2id-highlight{
    background: #0c71c3;
    }}

    Plugin Author malihu

    (@malihu)

    Can you disable back “Allow only one highlighted element at a time” and “Highlight by next target” options in plugin settings?

    Thread Starter magic22

    (@magic22)

    Now is better but when I click on item – Kontakt on mobile, then I have highlight with item – ?iernenie. When I click on item – ?iernenie there is no highlight.

    On tablet when I click on item – úvod there is highlight with item – O nás.

    Plugin Author malihu

    (@malihu)

    I can’t reproduce these issues on mobile. When I click/scroll to Kontakt or ?iernenie the appropriate link is highlighted (when I open the mobile menu again). Did you fix it or?

    If your testing tablet has enough vertical resolution, then you might see both úvod and O nás get highlighted because both sections will be within the user’s visible field. If you want to highlight only the clicked link, you should use the class .mPS2id-clicked in the CSS. Does this help?

    Thread Starter magic22

    (@magic22)

    .mPS2id-clicked is good for mobile and tablet. Thank you very much for help. Now is all perfect. Happy new year ??

    Plugin Author malihu

    (@malihu)

    You’re welcome ?? Happy new year!

    Thread Starter magic22

    (@magic22)

    Hello,
    I have another problem. On the site – https://www.virtualnarealitasr.sk I have different page – Hry a návody. On this page don’t work highlight. Can you help me please?

    Plugin Author malihu

    (@malihu)

    Hello again! I think you just need to add the highlight styling on the current-page menu items that are not handled by the plugin. Try adding the following to your CSS:

    #top-menu li.current-menu-item > a:not(._mPS2id-h){
        background: blueviolet;
        padding-top: 15px;
        margin-top: -20px;
    }
    Thread Starter magic22

    (@magic22)

    Your code don’t work but I contacted Divi support and they gave me code wich work.

    @media screen and (max-width: 980px) {
    li#menu-item-2645.current-menu-item {
    background: blueviolet;
    }}

    Thank you again ??

    Plugin Author malihu

    (@malihu)

    You’re welcome ??

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Offset on mobile’ is closed to new replies.