-
-
Save loschke/2d522a5126d6a9e4f9e58ccf747722ea to your computer and use it in GitHub Desktop.
Code Snippets zu Blogbeitrag https://sevenx.de/bootstrap-styled-jquery-auto-scroll-to-top-link-tutorial/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment