Fix scroll up button (#638)

* fix scroll-up button

* dist changes

* changes

* changes
This commit is contained in:
Mridul97
2019-01-11 07:52:51 +05:30
committed by Jeffrey Warren
parent 2e9689b905
commit 9e5f252fd4
5 changed files with 46 additions and 15 deletions

View File

@@ -52,6 +52,25 @@ window.onload = function() {
}
refreshOptions();
$(window).on('scroll', scrollFunction);
function scrollFunction() {
var shouldDisplay = $('body').scrollTop() > 20 || $(':root').scrollTop() > 20;
$('#move-up').css({
display: shouldDisplay ? 'block' : 'none'
});
}
function topFunction() {
$('body').animate({scrollTop: 0});
$(':root').animate({scrollTop: 0});
}
$('#move-up').on("click",topFunction);
// UI for each step:
sequencer.setUI(DefaultHtmlStepUi(sequencer));