MyBB Community Forums

Full Version: [Flatty Theme] How to re-add the blue scroll button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In my recent editing on the Flatty theme for my forum, I accidentally removed the blue scroll button that came with the Flatty theme.

[Image: 910cd0071a7afae06de2dc7a7536841d.png]

Does anyone know the code for it, and where exactly I have to put it?
ACP  »  Templates & Styles  »  Templates  »  {Theme} Templates  »  Footer Templates

Add this at the very top:

<script type="text/javascript">
jQuery(function($) {
  	$(window).scroll(function () {
  	  if ($(this).scrollTop() > 400) {
	  } else {
  $('.back-top').on( "click", function () {
	  $('html, body').animate({
		  scrollTop: 0
	  }, 700);
	  return false;

.. and this:

<a class="back-top"><span id='backtop'><i class="fa fa-angle-up"></i></span></a>

right above "<div id="footer">", after the two closing "</div>".
Thank you! Big Grin