Title: Offset on mobile
Last modified: December 29, 2023

---

# Offset on mobile

 *  Resolved [magic22](https://wordpress.org/support/users/magic22/)
 * (@magic22)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Foffset-on-mobile-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17308963)
 * 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](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17308977)
 * You might also need to add this PHP code in your theme/child-theme functions.
   php:
 *     ```wp-block-code
       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](https://wordpress.org/support/users/magic22/)
 * (@magic22)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17309017)
 * 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](https://wordpress.org/support/users/media/) screen and (max-width: 979px){
   
   a.mPS2id-highlight{background: #0c71c3;}}
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17309085)
 * Can you disable back “Allow only one highlighted element at a time” and “Highlight
   by next target” options in plugin settings?
 *  Thread Starter [magic22](https://wordpress.org/support/users/magic22/)
 * (@magic22)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17309244)
 * 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](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17309441)
 * 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](https://wordpress.org/support/users/magic22/)
 * (@magic22)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17312788)
 * .mPS2id-clicked is good for mobile and tablet. Thank you very much for help. 
   Now is all perfect. Happy new year 🙂
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17313455)
 * You’re welcome 🙂 Happy new year!
 *  Thread Starter [magic22](https://wordpress.org/support/users/magic22/)
 * (@magic22)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17341138)
 * Hello, 
   I have another problem. On the site – [https://www.virtualnarealitasr.sk](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](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17341492)
 * 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:
 *     ```wp-block-code
       #top-menu li.current-menu-item > a:not(._mPS2id-h){
           background: blueviolet;
           padding-top: 15px;
           margin-top: -20px;
       }
       ```
   
 *  Thread Starter [magic22](https://wordpress.org/support/users/magic22/)
 * (@magic22)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17345341)
 * Your code don’t work but I contacted Divi support and they gave me code wich 
   work.
 * [@media](https://wordpress.org/support/users/media/) screen and (max-width: 980px){
   
   li#menu-item-2645.current-menu-item {background: blueviolet;}}
 * Thank you again 🙂
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17348019)
 * You’re welcome 🙂

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Offset on mobile’ is closed to new replies.

 * ![](https://ps.w.org/page-scroll-to-id/assets/icon-256x256.png?rev=1401043)
 * [Page scroll to id](https://wordpress.org/plugins/page-scroll-to-id/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/page-scroll-to-id/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/page-scroll-to-id/)
 * [Active Topics](https://wordpress.org/support/plugin/page-scroll-to-id/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/page-scroll-to-id/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/page-scroll-to-id/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [malihu](https://wordpress.org/support/users/malihu/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/offset-on-mobile-2/#post-17348019)
 * Status: resolved