MyBB Community Forums
[Flatty Theme] How to re-add the blue scroll button - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: [Flatty Theme] How to re-add the blue scroll button (/thread-203271.html)



[Flatty Theme] How to re-add the blue scroll button - CrystalBlazier - 2016-09-29

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?



RE: [Flatty Theme] How to re-add the blue scroll button - m0ckingbird - 2016-09-30

ACP  »  Templates & Styles  »  Templates  »  {Theme} Templates  »  Footer Templates


Add this at the very top:

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

.. 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>".


RE: [Flatty Theme] How to re-add the blue scroll button - CrystalBlazier - 2016-09-30

Thank you! Big Grin