0 Replies Latest reply on Apr 19, 2006 4:29 PM by drforbin1970

    HOW TO KEEP TEXT AT BOTTOM OF PAGE USING JAVASCRIPT-ANSWERED

    drforbin1970 Level 1
      UPDATE 5/12/2006: MORE COMPATIBLE CODE:
      Was using OnRequestEnd.cfm to load copyright info at bottom of each page but page size varied and copyright info would appear at different points on different pages. Didn't look good. Could not use tables to align the text for output reasons. Coded a way using CSS and JavaScript to keep text at bottom of each page. Be careful with CFFORM, us have to set the attribute 'wMode=transparent' in CFFORM so text is above form. Tested in IE and Netscape. Put at end of individual templates or inside OnRequestEnd.cfm - Enjoy!

      (css goes in your external css file or between local style tags)
      .copyright{background-color:#d8d8d8;color:Black;font-size:10px;font-family:Arial;width:10 0%;text-align:center;}
      body {border-bottom-width:0px;}


      (following goes at end of page or in OnRequestEnd.cfm)
      <span id="x" class="copyright">
      my copyright
      </span>

      <!--- *** KEEPS COPYRIGHT LINE AT ABSOLUTE BOTTOM OF EACH PAGE --->
      <script>
      if(document.body.scrollHeight < document.body.clientHeight){
      var s = 0;
      document.getElementById('x').style.cssText='position:absolute;bottom:'+s+';';
      }
      else {
      var s = document.body.scrollHeight;
      document.getElementById('x').style.cssText='position:absolute;top:'+s+';';
      }
      </script>