Guest User

test

a guest
Jan 20th, 2015
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.17 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
  6.     <style type="text/css">
  7.         body {
  8.             margin: 0;
  9.             padding: 0;
  10.             height: 100%;
  11.         }
  12.         #left_side {
  13.             position: fixed;
  14.             top: 0;
  15.             left: 0;
  16.             right: 50%;
  17.             bottom: 0;
  18.             background: #cccccc;
  19.         }
  20.         #right_side {
  21.             position: fixed;
  22.             top: 0;
  23.             left: 50%;
  24.             right: 0;
  25.             bottom: 0;
  26.             background: #000000;
  27.         }
  28.         #right_side.toggled {
  29.             background: #ffffff;
  30.         }
  31.     </style>
  32. </head>
  33. <body>
  34.     <div id="left_side"></div>
  35.     <div id="right_side" class="toggled"></div>
  36.     <script type="application/javascript">
  37.         var toggleRightSide = function(){
  38.             $('#right_side').toggleClass('toggled');
  39.         };
  40.         $(document).on('keypress', toggleRightSide);
  41.         $('#right_side').on('click', toggleRightSide);
  42.     </script>
  43. </body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment