mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-12 19:30:00 +01:00
Include a back-to-top Button on scrolling down (#446)
* Update index.html * Create scrollToTop.js * Update demo.css * Update index.html
This commit is contained in:
@@ -137,3 +137,24 @@ h1 {
|
|||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.move-up {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 50px;
|
||||||
|
right: 40px;
|
||||||
|
z-index: 3;
|
||||||
|
display: none;
|
||||||
|
z-index:1000;
|
||||||
|
}
|
||||||
|
.move-up button {
|
||||||
|
background:transparent;
|
||||||
|
border:none;
|
||||||
|
}
|
||||||
|
.move-up button:active:hover {
|
||||||
|
padding-right:4px !important;
|
||||||
|
margin-right:2px;
|
||||||
|
}
|
||||||
|
.move-up i {
|
||||||
|
font-size:60px;
|
||||||
|
opacity:0.5;
|
||||||
|
color:#BABABA;
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
|
|
||||||
<!-- Download.js for large files -->
|
<!-- Download.js for large files -->
|
||||||
<script src="../node_modules/downloadjs/download.min.js" type="text/javascript"/>
|
<script src="../node_modules/downloadjs/download.min.js" type="text/javascript"/>
|
||||||
|
|
||||||
|
<script src="lib/scrollToTop.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
||||||
@@ -123,6 +126,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<button class="btn btn-primary btn-lg" name="save-sequence" id="save-seq">Save Sequence</button>
|
<button class="btn btn-primary btn-lg" name="save-sequence" id="save-seq">Save Sequence</button>
|
||||||
</div>
|
</div>
|
||||||
|
<form class="move-up" action="#up">
|
||||||
|
<button><i class="fa fa-arrow-circle-o-up"></i></button>
|
||||||
|
</form>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
var sequencer;
|
var sequencer;
|
||||||
|
|||||||
17
examples/lib/scrollToTop.js
Normal file
17
examples/lib/scrollToTop.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
$(document).ready(function($){
|
||||||
|
$(function(){
|
||||||
|
$(window).scroll(function(){
|
||||||
|
if ($(this).scrollTop() > 100){
|
||||||
|
$('.move-up').fadeIn();
|
||||||
|
} else {
|
||||||
|
$('.move-up').fadeOut();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('.move-up button').click(function(){
|
||||||
|
$('body,html').animate({
|
||||||
|
scrollTop: 0
|
||||||
|
}, 800);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user