Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

footer bottom

<script>
    $(document).ready(function() {
        setInterval(function() {
            var docHeight = $(window).height();
            var footerHeight = $('#footer').height();
            var footerTop = $('#footer').position().top + footerHeight;
            var marginTop = (docHeight - footerTop + 10);

            if (footerTop < docHeight)
                $('#footer').css('margin-top', marginTop + 'px'); // padding of 30 on footer
            else
                $('#footer').css('margin-top', '0px');
            // console.log("docheight: " + docHeight + "
" + "footerheight: " + footerHeight + "
" + "footertop: " + footerTop + "
" + "new docheight: " + $(window).height() + "
" + "margintop: " + marginTop);
        }, 250);
    });
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: detect if user is online react 
Javascript :: vue store access state in actions 
Javascript :: setCenter: not a LatLng or LatLngLiteral with finite coordinates: in property lat: not a number 
Javascript :: jest express testing 
Javascript :: js set 
Javascript :: discord delete message 
Javascript :: updating an array of object in mongoose 
Javascript :: how to check if string is valid jwt 
Javascript :: Prisma where in array 
Javascript :: toggle 
Javascript :: radio button not checked 
Javascript :: javascript heap out of memory error 
Javascript :: Aug 25 2020 00:00:00 GMT+0530 
Javascript :: generate qr code react 
Javascript :: concat emoji with text in react js 
Javascript :: find intersection between two object arrays javascript 
Javascript :: sum of two array in javascript 
Javascript :: how to map through an object javascript 
Javascript :: convert timestamp to date js 
Javascript :: hoisting in javascript 
Javascript :: add font awesome with nextjs 
Javascript :: methods javascript 
Javascript :: js add timestamp clg 
Javascript :: how to clear array in javascript 
Javascript :: show and hide element in react 
Javascript :: shadow react native generator 
Javascript :: convert json data to a html table 
Javascript :: javascript Display a Text Once After 3 Second 
Javascript :: javascript Create a RegEx 
Javascript :: datepicker toltip 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =