Commit 743984d4 authored by Patrick's avatar Patrick

Add sticky back to top button on order form

parent c55c0790
......@@ -368,6 +368,14 @@ ul.djng-field-errors li.valid::before {
position:sticky;
bottom:65px;
}
/* https://www.w3schools.com/howto/howto_js_scroll_to_top.asp */
.back-to-top-sticky-button{
display:none;
position:fixed;
bottom:20px;
right:30px;
z-index:2000;
}
/* Bootstrap refresh animated */
.gly-spin {
-webkit-animation: spin 2s infinite linear;
......
......@@ -49,9 +49,18 @@
{% endif %}
<div class="loaded" style="display: none;">
<div class="clearfix visible-sm-block visible-md-block visible-lg-block"></div>
<a class="btn btn-default btn-disabled" href="#top"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span></a>
<a class="btn btn-default btn-disabled back-to-top-sticky-button" id="backToTop" href="#top"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span></a>
</div>
<script>
{# https://www.w3schools.com/howto/howto_js_scroll_to_top.asp#}
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("backToTop").style.display = "block";
} else {
document.getElementById("backToTop").style.display = "none";
}
}
var infinite = new Waypoint.Infinite({
element: $('.infinite-container')[0],
onBeforePageLoad: function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment