Function "Go to top”

Hi
I found the “Go to top” function in scripts, but I do not have this button on the site. How do I activate it without using a third-party plugin?

file: js/scripts.js -> //Go to top

Hello there,

It looks like the button is missing from our theme. I’ll let our developer knows about it. Thank you for reporting.

Regards,
Kharis

Thanks, I’ll wait for the template update :slight_smile:

Hello, could not wait to update the topic, did everything himself! :slight_smile:

The file scripts.min.js has a GO TO TOP function, but there are no buttons in the template.
//Go to top jQuery(function($) { var goTop = $('.go-top'); $(window).scroll(function() {if ( $(this).scrollTop() > 800 ) { goTop.addClass('show'); } else {goTop.removeClass('show');}});

In order for the button to work, you need to add it to style.css and footer.php. Here’s how I did it:

footer.php (insert before the tag </body>) >>>

<a class="go-top" href="#">TOP</a>

style.css >>>

.go-top, .go-top:focus {
	display: none;
	position: fixed;
	right: 30px;
	bottom: 30px;
	text-align: center;
	line-height: 70px;
	width: 56px;
	height: 56px;
	background-color: rgba(50,50,50,0.4);
	background-image: url(arrow_totop.png);
	background-repeat: no-repeat;
	background-position: center 15px;
	color: #fff;
	text-decoration:none;
	border-radius: 3px;
	transition: all .1s linear;
}

.go-top:hover {
	background-color: rgb(255, 96, 96);
	color: #fff;
	text-decoration:none;
	transition: all .1s linear;
}

.show {
display: inline;	
}

As a result, the button appears when scrolling to 800 pixels. You can change this value to any other value in scripts.min.js.

218753