To top plugin and scroll top not working on mobile

Scroll to top button not working on mobile, we tried different plugins without success. I have added custom code. It shows but still don't work.

  • Kris Tomczyk

    Hi Marcus,

    Hope you are doing good today.

    I found the cause of the problem. It is a code

    html, body{
      overflow: auto;
      }

    in your Simple Custom CSS plugin. When I delete that code everything works fine on mobile devices. Unfortunately, I also see that you are using help from wpcurve.com support. It can be seen exactly in the code:

    /* WP Curve #96502 - JTG - Start */
    @media only screen and (max-width:767px) {
    span.click_menu{
    	position: fixed !important;
        top: 0px !important;
        background: #00376E !important;
        left: 0px !important;
        width: 100%;
        padding: 20px !important;
        max-width: 100%;
    }
    
       html, body{
      overflow: auto;
      } 
    
    .header.sticky{
    display:block !important;
    }
    
      .header{
      padding-top:50px !important;
      }
    
      .header.sticky .nav {
        margin-top: 0px !important;
    }
      .nav{
      position: fixed !important;
        top: 60px !important;
      }
      .nav ul li a{
      color: #fff !important;
      }
    }
    /* WP Curve #96502 - JTG - End */

    in your Simple Custom CSS. 96502 number it can be a your ticket with some person you ask for solve some issue. Please check wpcurve.com support conversation with this ID. I do not know the reason why someone inserted it, please can you check it? If I delete this code scrolling will start works. But there is a risk that something will stop working.

    Kind Regards,
    Kris

  • Marcus

    Yes it's fine now, that's the way it should appear. Here's the code we added:

    $stjq(document).ready(function(){
    $stjq(window).scroll(function(){
    var getScroll = $stjq(this).scrollTop();
    if (getScroll > 10){
    $stjq('.header').addClass('sticky-menu');
    }else {
    $stjq('.header').removeClass('sticky-menu');
    }
    });

    and a lot of css:

    .header.sticky-menu {
    background-color: #fff;
    }
    .sticky-menu .logo {
    margin-top: 0;
    }
    .sticky-menu a {
    color: #00376e !important;
    margin-top: 15px;
    }
    .sticky-menu .logo {
    margin-top: 0;
    }
    .sticky-menu a {
    color: #00376e !important;
    margin-top: 15px;
    }
    .sticky-menu .search_top {
    top: 38px;
    }
    .sticky-menu .logo2 {
    display: block !important;
    }
    .sticky-menu .logo {
    margin-top: 0;
    display: none !important;
    }
    .sticky-menu .logo2 {
    display: block !important;
    float: left;
    }

    On the scroll top mobile issue, the code you send was added by WP curve. WPcurve was our developer before, they're out of business now and I have cant' contact them anymore. What's your idea with this so we can make the scroll top functioning on mobile?

    Thank you Kris!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.