Advertisement
michaelyuen

Untitled

May 30th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <head>
  3. <script
  4.   src="https://code.jquery.com/jquery-2.2.4.min.js"
  5.   integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
  6.   crossorigin="anonymous"></script>
  7. </head>
  8. <style>
  9.     .top {
  10.         height: 150px;
  11.         width: 100%;
  12.         background-color: #86af49;
  13.     }
  14.  
  15.     .navbar-menu ul {
  16.         display: inline-block;
  17.         margin: 0;
  18.         padding: 0;
  19.         width: 100%;
  20.         list-style: none;
  21.         background-color: #44883d;
  22.     }
  23.  
  24.     .navbar-menu li {
  25.         float: left;
  26.         padding: 5px 15px;
  27.     }
  28.  
  29.     .navbar-menu.active-top {
  30.         position: fixed;
  31.         top: 0;
  32.         left: 0;
  33.         right: 0;
  34.     }
  35.  
  36.     .dummy-content {
  37.         display: inline-block;
  38.         padding: 20px 0;
  39.         width: 100%;
  40.         text-align: left;
  41.     }
  42. </style>
  43. <body>
  44.     <div class="top">
  45.         Something here. May be an image
  46.     </div>
  47.     <div class="navbar-menu">
  48.         <ul class="navbar">
  49.             <li>Home</li>
  50.             <li>Product</li>
  51.         </ul>
  52.     </div>
  53.     <div class="dummy-content">
  54.         <p>
  55.             What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type
  56.             specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently
  57.             with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
  58.         <p>&nbsp;</p>
  59.         <p>Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to
  60.             using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their
  61.             infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
  62.         <p>&nbsp;</p>
  63.         <p>Where does it come from?</p>
  64.         <p>
  65.             &nbsp;
  66.         </p>
  67.         <p>
  68.             Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up
  69.             one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum
  70.             et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section
  71.             1.10.32.</p>
  72.         <p>
  73.             &nbsp;
  74.         </p>
  75.         <p>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions
  76.             from the 1914 translation by H. Rackham. </p>
  77.     </div>
  78. <script>
  79.     $(document).ready(function() {
  80.         $(window).on("scroll", function() {
  81.             var scrollPos = $(window).scrollTop();
  82.             if (scrollPos > 150) {
  83.                 $(".navbar-menu").addClass('active-top');
  84.                 return false;
  85.             } else {
  86.                 $(".navbar-menu").removeClass('active-top');
  87.                 return false;
  88.             }
  89.         });
  90.     });
  91. </script>
  92. </body>
  93. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement