I have a button (#buttonScrolltop) pinned on all my website pages and I wish it to be displayed only when the visitor starts scrolling from about 200px from the top of the pages …
I set the button as “hidden” in initial state. ID button : #buttonScrolltop
I write this code but it does not work ! Someone to help me please?
function scrollFunction ( window ) {
$w ( window ). scroll ( function () { if ( $w ( this ). scrollTop () > 200 ) {
$w ( ‘#buttonScrolltop’ ). show ();
} else {
$w ( ‘#buttonScrolltop’ ). hide ();
}
});
}