Hotfix floating button

This commit is contained in:
Daniel 2018-09-20 10:41:46 +02:00
parent efaf5140f7
commit 0df553a33b
3 changed files with 9 additions and 4 deletions

View file

@ -15,7 +15,11 @@
<script type="text/javascript"> <script type="text/javascript">
function scrollFunction() { function scrollFunction() {
var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight {% if include.heightref %}
var h = document.getElementById('{{ include.heightref }}').offsetTop
{% else %}
var h = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) / 4
{% endif %}
if (document.body.scrollTop > h || document.documentElement.scrollTop > h) { if (document.body.scrollTop > h || document.documentElement.scrollTop > h) {
document.getElementById("floating-button").classList.add("visible"); document.getElementById("floating-button").classList.add("visible");
} else { } else {

View file

@ -1,7 +1,7 @@
#floating-button { #floating-button {
position: fixed; position: fixed;
right: 25px;
top: 25px; top: 25px;
right: 25px;
box-shadow: 1px 2px 3px 1px #718399; box-shadow: 1px 2px 3px 1px #718399;
background-color: $discreet; background-color: $discreet;
// width: 64px; DEFINED BELOW! // width: 64px; DEFINED BELOW!
@ -40,7 +40,8 @@
@media only screen and (max-width: 767px) { @media only screen and (max-width: 767px) {
#floating-button { #floating-button {
width: 51px; width: 51px;
right: -4px; top: 10px;
right: 10px;
} }
} }

View file

@ -8,7 +8,7 @@ title: Safing
</head> </head>
<body> <body>
{% include header.html home=true %} {% include header.html home=true %}
{% include floating_button.html download=true %} {% include floating_button.html heightref="portmaster" download=true %}
<div class='content' style='background-image: url("/assets/img/shortlandscape.png"); background-size: 100%;background-repeat: no-repeat;'> <div class='content' style='background-image: url("/assets/img/shortlandscape.png"); background-size: 100%;background-repeat: no-repeat;'>
<div class='ui grid'> <div class='ui grid'>
<div class='computer only sixteen wide column' style='height: 10rem;'></div> <div class='computer only sixteen wide column' style='height: 10rem;'></div>