javascript - Full screen background slideshow messing up responsive sticky footer -


i trying position sticky footer in place full screen background slideshow somehow moves under content. following responsive sticky footer tutorial site sticky footer tutorial page content set display:table , footer set display:table-row. works great until introduce slideshow picture. once remove slideshow sticky footer works!. there way fix problem , keep sticky footer @ bottom?. can see problem live here link problem.

my css , html

<!doctype html> <html>     <head>         <title> html structure</title>         <script type="text/javascript" src="/jquery-2.1.4.min.js"></script>          <script type="text/javascript" src="/jquery-bgstretcher-3.3.1.min.js"></script>          <style>         html {         height: 100%;         overflow: hidden;         }          body {         height: 100%;         overflow: scroll;         -webkit-overflow-scrolling: touch;         }          .site {         display: table;         height: 100%;         table-layout: fixed;         width: 100%;         }          .site-content {         width: 100%;         color:#fbf7f7;         text-align:center;         background:#2defec repeat;         height:200px;         margin-bottom:10px;         }          .site-footer {         display: table-row;         height: 1px;         background:#2a1818 repeat;         width:100%;         color:#fbf7f7;         text-align:center;         }          .bgstretcher-area {         text-align: left;         }         .bgstretcher {         background: black;         overflow: hidden;         width: 100%;         position: fixed;         z-index: 1;         }         .bgstretcher,         .bgstretcher ul,         .bgstretcher li {         left: 0;         top: 0;         }         .bgstretcher ul,         .bgstretcher li {         position: absolute;         }         .bgstretcher ul,         .bgstretcher li {         margin: 0;         padding: 0;         list-style: none;         }         /*  compatibility old browsers  */         .bgstretcher {         _position: absolute;         }         .bgs-description-pane {         display: block;         background: rgba(0, 0, 0, 0.7);         position: relative;         z-index: 10000;         padding: 15px;         color: #ffffff;         font-size: 14px;         }                </style>     </head>     <body>         <div id="page" class="hfeed site">             <header id="masthead" class="site-header" role="banner"></header>             <div id="content" class="site-content">i content!</div>             <footer id="colophon" class="site-footer" role="contentinfo">i footer</footer>         </div>     </body>     <script type="text/javascript">         jquery(function($){         $("body").bgstretcher({         images: ["/1-1.jpg", "/2-1.jpg"],          imagewidth: 1024,         imageheight: 768         });          });          </script> </html> 

you should make complete table layout in order have sticky footer work properly. check out following simplified demo , read comments inline, see if you're missing important.

jsfiddle

html, body, #page {      height: 100%; /*make elements cover whole page height*/      margin: 0;  }  #page {      display: table;      width: 100%;  }  .site-header,  .site-content,  .site-footer {      display: table-row; /*for 3 sections*/  }  .site-content {      height: 100%; /*push header , footer minimum height */      background: silver;  }
<div id="page" class="hfeed site">      <header id="masthead" class="site-header" role="banner">header</header>      <div id="content" class="site-content">i content!</div>      <footer id="colophon" class="site-footer" role="contentinfo">i footer</footer>  </div>

update, jquery plugin op's using, added container divs around #page, either set them height:100%;, or set #page{height:100vh;} revised jsfiddle.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -