(22 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
<script> | <script> | ||
+ | |||
// When the user clicks on <span> (x), close the modal | // When the user clicks on <span> (x), close the modal | ||
Line 29: | Line 30: | ||
− | + | $(document).ready( function(){ | |
− | + | ||
var whight = $(window).height(); | var whight = $(window).height(); | ||
var dhight = $("#footer").offset().top; | var dhight = $("#footer").offset().top; | ||
Line 41: | Line 41: | ||
bre = bre.concat("<br>") | bre = bre.concat("<br>") | ||
} | } | ||
− | } | + | }); |
− | $(document). | + | $(window).resize( function(){ |
+ | var whight = $(window).height(); | ||
+ | var dhight = $("#footer").offset().top; | ||
+ | var dimen = $("#footer").height(); | ||
+ | var bre = document.getElementById("foot-comp").innerHTML | ||
+ | |||
+ | while (whight < dhight+dimen) { | ||
+ | bre = bre.slice(0,-4) | ||
+ | document.getElementById("foot-comp").innerHTML = bre | ||
+ | var dhight = $("#footer").offset().top; | ||
+ | |||
+ | if (bre.length == 0){break} | ||
+ | } | ||
+ | |||
+ | while (whight > dhight+dimen) { | ||
+ | bre = bre.concat("<br>") | ||
+ | document.getElementById("foot-comp").innerHTML = bre | ||
+ | var dhight = $("#footer").offset().top; | ||
+ | } | ||
+ | }); | ||
Latest revision as of 23:11, 19 October 2016