Guest User

Untitled

a guest
Jan 3rd, 2011
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.96 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <style>
  5.             #footwrap {                     /*scrolling footer box that contains the footer div (the contentent)*/
  6.                 background-color:#003366;   /*debug color (can be removed to make transparent)*/
  7.                 position:fixed;             /*locked to screen*/
  8.                 width:100%;                 /*make width of browser (keem this at 100% even of content is smaller)*/
  9.                 height:100px;               /*height of footer (user defianable)*/
  10.                 bottom:0px;                 /*locked to bottom of screen*/
  11.                 left:0;                     /*locked to left of screen*/
  12.                 overflow:hidden;            /*lets the content act like a box that can scroll but dont show scroll bars*/
  13.             }
  14.             #foot{
  15.                 width:1000px;               /*width of footer content (should be about roughfly the same size of the page content width)*/
  16.                 background-color:#ff0000;   /*debug color*/
  17.             }
  18.         </style>
  19.         <script src="http://code.jquery.com/jquery-1.4.4.js"></script> <!--Include jQuery, Re host this on your own server once you move to production-->
  20.     </head>
  21.     <body>
  22.         <div>Resize window so horisontal scroll bar appears, Then try scrolling</div>
  23.         <p>___________________________________________________________________________________________________________________________</p>
  24.         <div id="footwrap"><br /><div id="foot">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut dui nec massa gravida elementum. Aliquam tempor vehicula augue, tempus consectetur dui sollicitudin nec. Pellentes</div></div>
  25.  
  26.         <script>
  27.             $(window).scroll(function () {                          //On window scroll event run function(){this}.
  28.                 $("#footwrap").scrollLeft(window.pageXOffset);      // see below to full explanation
  29.             });                                                    
  30.         </script>
  31.     </body>
  32.     <!--
  33.     $("#footwrap").scrollLeft(window.pageXOffset);
  34.    
  35.     $("#footwrap")      = Select footwrap div using its ID
  36.     .scrollLeft()       = The scroll left propertie (aka horizontal scroll in px)
  37.     window.pageXOffset  = The window objects page X offset proptery value.(how far from the left is the horistonal scroll in px)
  38.     -->
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment