Added scroll to top button
This commit is contained in:
12
templates/Sparkle/assets/css/main.css
vendored
12
templates/Sparkle/assets/css/main.css
vendored
@@ -930,3 +930,15 @@ caption {
|
|||||||
font-weight:700;
|
font-weight:700;
|
||||||
margin-bottom:.2em;
|
margin-bottom:.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.scrollup {
|
||||||
|
width:40px;
|
||||||
|
height:40px;
|
||||||
|
opacity:0.3;
|
||||||
|
position:fixed;
|
||||||
|
bottom:15px;
|
||||||
|
left:100px;
|
||||||
|
display:none;
|
||||||
|
text-indent:-9999px;
|
||||||
|
background: url(../img/top.png) no-repeat;
|
||||||
|
}
|
||||||
BIN
templates/Sparkle/assets/img/top.png
vendored
Normal file
BIN
templates/Sparkle/assets/img/top.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
27
templates/Sparkle/assets/js/main.js
vendored
27
templates/Sparkle/assets/js/main.js
vendored
@@ -6,10 +6,19 @@ function twoDigits(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Format date in header
|
// Scroll to top
|
||||||
var lastlogin = new Date($("#lastlogin").text() * 1000);
|
$(window).scroll(function() {
|
||||||
//var d = Date.parse(lastlogin);
|
if ($(this).scrollTop() > 100) {
|
||||||
$("#lastlogin").text(lastlogin.getFullYear() + "-" + twoDigits(lastlogin.getMonth()) + "-" + twoDigits(lastlogin.getDate()) + " " + twoDigits(lastlogin.getHours()) + ":" + twoDigits(lastlogin.getMinutes()) + ":" + twoDigits(lastlogin.getSeconds()));
|
$('.scrollup').fadeIn();
|
||||||
|
} else {
|
||||||
|
$('.scrollup').fadeOut();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.scrollup').click(function() {
|
||||||
|
$("html, body").animate({ scrollTop: 0 }, 600);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
// this is necessary for the special setting feature (ref #1010)
|
// this is necessary for the special setting feature (ref #1010)
|
||||||
$.getQueryVariable = function(key) {
|
$.getQueryVariable = function(key) {
|
||||||
@@ -40,22 +49,12 @@ $(document).ready(function() {
|
|||||||
// make rel="external" links open in a new window
|
// make rel="external" links open in a new window
|
||||||
$("a[rel='external']").attr('target', '_blank');
|
$("a[rel='external']").attr('target', '_blank');
|
||||||
$(".main").css('min-height', $("nav").height() - 134);
|
$(".main").css('min-height', $("nav").height() - 134);
|
||||||
//$(".dboarditem:last").css('min-height', $(".dboarditem:first").height());
|
|
||||||
//$(".dboarditem:first").css('min-height', $(".dboarditem:last").height());
|
|
||||||
|
|
||||||
// set focus on username-field if on loginpage
|
// set focus on username-field if on loginpage
|
||||||
if ($(".loginpage").length != 0) {
|
if ($(".loginpage").length != 0) {
|
||||||
$("#loginname").focus();
|
$("#loginname").focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if ($("table.formtable").length != 0) {
|
|
||||||
$("table.formtable tr").hover(function() {
|
|
||||||
$(this).css("background-color", "#f5f5f5");
|
|
||||||
}, function() {
|
|
||||||
$(this).css("background-color", "#fff");
|
|
||||||
});
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if ($("table.bradiusodd").length != 0) {
|
if ($("table.bradiusodd").length != 0) {
|
||||||
$("table.bradiusodd tbody tr").hover(function() {
|
$("table.bradiusodd tbody tr").hover(function() {
|
||||||
$(this).css("background-color", "#f5f5f5");
|
$(this).css("background-color", "#f5f5f5");
|
||||||
|
|||||||
1
templates/Sparkle/footer.tpl
vendored
1
templates/Sparkle/footer.tpl
vendored
@@ -10,5 +10,6 @@
|
|||||||
<br /><span>{$lng['panel']['translator']}: {$lng['translator']}
|
<br /><span>{$lng['panel']['translator']}: {$lng['translator']}
|
||||||
</if>
|
</if>
|
||||||
</footer>
|
</footer>
|
||||||
|
<a href="#" class="scrollup">Scroll</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user