loschke
2/3/2020 - 10:04 PM

Blog - Bootstrap styled jQuery Auto Scroll to Top Link

<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>

<script src="js/scroll-top.js"></script>

<!-- Initialisieren -->
<script type="text/javascript">

   $(document).ready(function(){

      $('.top').UItoTop();

   });
</script>
<style>
  /* TO TOP*/
#toTop-right {
	display:none;
	text-decoration:none;
	position:fixed;
	bottom:20px;
	right:20px;
	outline:none;
}
#toTop-left {
	display:none;
	text-decoration:none;
	position:fixed;
	bottom:20px;
	left:20px;
	outline:none;
}
#toTop-center {
	display:none;
	text-decoration:none;
	position:fixed;
	bottom:10px;
	left:50%;
	margin-left:-20px; /*Feintuning je nach Inhalt */
	outline:none;
}
</style>
var defaults = {			
   autoLinkPos: 'toTop-right', //toTop-left, toTop-center
   autoLinkClass: 'btn btn-large btn-danger', // example:'badge badge-warning' 'label label-info'
   autoLinkText: 'nach oben', //Linktext, optional wenn Icon vorhanden   
   autoLinkIcon: 'icon-chevron-up icon-white', //Bootstrap Icon, optional wenn Text vorhanden
   easingType: 'easeOutBounce',  //default without Easing: 'linear' or 'swing'		
   min: 400, //Anzahl gescrollter Pixel bis zum Einblenden
   inDelay:500,
   outDelay:500,
   scrollSpeed: 750, //Scrolldauer
   contentLinkClass: 'top' //class Name der manuellen Contentlinks
};
<a href="#" class="top btn btn-warning"><i class="icon-arrow-up icon-white"></i> nach oben</a>

<a href="#" class="top label label-info pull-right">Seitenanfang</a>

<a href="#" class="top badge badge-success"><i class="icon-circle-arrow-up icon-white"></i> nach oben</a>