Su stop scroll to top of page flatsome

Here is the code to hide the button, you can put in Enfold > General Styling > Quick Css, if it does not work, put into themes/enfold/css/custom.css



# scroll-top-link {display: none; }

If you need further assistance please let us know.

Best regards, Victoria

July 22, 2018 at 11:47 pm

This is the thing: I already tried it and yes it hides the button. But the scroll to top script is still running on the page and when you scroll down regardless that the button isn’t appearing the script is still running and interfering with the other Javascript stuff (namely my parallax effects) I have on the page. So I just want to completely stop this script that enables the scroll to top functionality so that it doesn’t cause the problems any more. Can you help me do this?

July 23, 2018 at 4:46 am

Hi,

This is the only script related to the scroll to top button. It’s in the js > avia.js file.

   function avia_scroll_top_fade()
   {
        var win     = $(window),
           timeo = false,
           scroll_top = $('
# scroll-top-link'),
           set_status = function()
             {
               var st = win.scrollTop();
               if(st < 500)
               {
                 scroll_top.removeClass('avia_pop_class');
               }
               else if(!scroll_top.is('.avia_pop_class'))
               {
                 scroll_top.addClass('avia_pop_class');
               }
             };
        win.on( 'scroll',  function(){ window.requestAnimationFrame( set_status )} );
         set_status();
  }

Best regards, Ismael

July 23, 2018 at 7:27 pm

So i removed this function from avia.js and the scroll to top button still works normally. What is going on here?

July 24, 2018 at 12:48 pm

Hi,

That script will only make the scroll to top button display. It won’t affect how the button works. Did you enable the css/js compression in the Performance panel? Please disable those temporarily and then re-check the page. Unfortunately, we don’t provide support for third party plugins and script as stated on our support policy. Please keep in touch with the plugin authors.

Beware! This will still add an entry to the browser's history when clicked, meaning that after clicking your link, the user's back button will not take them to the page they were previously on. For this reason, it's probably better to use the .preventDefault() approach, or to use both in combination.

Here is a Fiddle illustrating this (just scrunch your browser down until your get a scrollbar): http://jsfiddle.net/9dEG7/


For the spec nerds - why this works:

This behaviour is specified in the HTML5 spec under the section. The reason that a link with a href of "#" causes the document to scroll to the top is that this behaviour is explicitly specified as the way to handle an empty fragment identifier:

2. If fragid is the empty string, then the indicated part of the document is the top of the document

Using a href of "#!" instead works simply because it avoids this rule. There's nothing magic about the exclamation mark - it just makes a convenient fragment identifier because it's noticeably different to a typical fragid and unlikely to ever match the id or name of an element on your page. Indeed, we could put almost anything after the hash; the only fragids that won't suffice are the empty string, the word 'top', or strings that match name or id attributes of elements on the page.

More exactly, we just need a fragment identifier that will cause us to fall through to step 8 in the following algorithm for determining the indicated part of the document from the fragid:

1. Apply the URL parser algorithm to the URL, and let fragid be the fragment component of the resulting parsed URL.
  1. If fragid is the empty string, then the indicated part of the document is the top of the document; stop the algorithm here.
  2. Let #!`2 be the result of percent-decoding `fragid.
  3. Let #!`4 be the result of applying the UTF-8 decoder algorithm to #!2. If the UTF-8 decoder emits a decoder error, abort the decoder and instead jump to the step labeled #!6.
  4. If there is an element in the DOM that has an ID exactly equal to #!4, then the first such element in tree order is the indicated part of the document; stop the algorithm here.
  5. No decoded fragid: If there is an a element in the DOM that has a name attribute whose value is exactly equal to `fragid (not #!`4), then the first such element in tree order is the indicated part of the document; stop the algorithm here.
  6. If fragid is an ASCII case-insensitive match for the string #`0, then the indicated part of the document is the top of the document; stop the algorithm here.
  7. Otherwise, there is no indicated part of the document.

As long as we hit step 8 and there is no indicated part of the document, the following rule comes into play:

How do I turn off scroll to top in WordPress?

You can choose to show or disable the Scroll to Top button in the Footer. Just follow the steps below: From your WordPress Dashboard, go to the Appearance > Customize > Footer > Scroll to Top section. Switch off the Enable Scroll to Top option.

How do I stop a website from scrolling?

For disabling the horizontal scrolling we can set the property overflow-x to hidden along with the height is set to 100%.

How do I stop my page from scrolling by itself?

Right-click on the Windows Start button and select Settings..

Select Bluetooth and devices from the left sidebar..

In the right pane, click Mouse..

Turn off the toggle next to Scroll inactive windows when hovering over them..

How do I stop scrolling events?

Handle scroll stop.

Use EventTarget. addEventListener() to listen for the 'scroll' event..

Use setTimeout() to wait 150 ms until calling the given callback ..

Use clearTimeout() to clear the timeout if a new 'scroll' event is fired in under 150 ms..