Add Go to top button
This commit is contained in:
parent
13d3b701f0
commit
fbaf709510
|
@ -663,6 +663,7 @@ void Print_Head( FILE* fp ){
|
||||||
<link href=\"../../../../../styles/top.css\" rel=\"stylesheet\" type=\"text/css\" >\n\
|
<link href=\"../../../../../styles/top.css\" rel=\"stylesheet\" type=\"text/css\" >\n\
|
||||||
</head>\n\
|
</head>\n\
|
||||||
<body>\n\
|
<body>\n\
|
||||||
|
<button onclick=\"topFunction()\" id=\"myBtn\" title=\"Go to top\">Top</button>\n\
|
||||||
<table>\n\
|
<table>\n\
|
||||||
<colgroup>\n\
|
<colgroup>\n\
|
||||||
<col span=\"3\" style=\"background-color:white\">\n\
|
<col span=\"3\" style=\"background-color:white\">\n\
|
||||||
|
|
|
@ -92,3 +92,18 @@ function class_one_four(){
|
||||||
div.className = 'animation one_four';
|
div.className = 'animation one_four';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When the user scrolls down 20px from the top of the document, show the button
|
||||||
|
window.onscroll = function() {scrollFunction()};
|
||||||
|
|
||||||
|
function scrollFunction() {
|
||||||
|
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
|
||||||
|
document.getElementById("myBtn").style.display = "block";
|
||||||
|
} else {
|
||||||
|
document.getElementById("myBtn").style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// When the user clicks on the button, scroll to the top of the document
|
||||||
|
function topFunction() {
|
||||||
|
document.body.scrollTop = 0;
|
||||||
|
document.documentElement.scrollTop = 0;
|
||||||
|
}
|
||||||
|
|
|
@ -34,6 +34,19 @@ th {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
#myBtn {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 10px;
|
||||||
|
right: 10px;
|
||||||
|
z-index: 99;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #555;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
/*Top Page styling begins*/
|
/*Top Page styling begins*/
|
||||||
#frame_1{
|
#frame_1{
|
||||||
width:49%;
|
width:49%;
|
||||||
|
|
Loading…
Reference in New Issue