Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 1.01 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Horizontal Div Slider
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Untitled Document</title>
  5. <script type="text/javascript" src="TestSite/js/jquery.js"></script>
  6. <script type="text/javascript">
  7. $(document).ready(function() {
  8.  $('#slideleft button').click(function() {
  9. var $lefty = $(this).next();
  10. $lefty.animate({
  11.   left: parseInt($lefty.css('left'),10) == 0 ?
  12.   -$lefty.outerWidth() :
  13.   0
  14. });
  15. });
  16. });
  17. </script>
  18.  
  19. <style>
  20.  
  21. .slide {
  22. position: relative;
  23. overflow: hidden;
  24. height: 120px;
  25. width: 350px;
  26. margin: 1em 0;
  27. background-color: #FFF;
  28. border: 1px solid #999;
  29. }
  30. .slide .inner {
  31. position: absolute;
  32. left: 0;
  33. bottom: 0;
  34. width: 338px;
  35. height: 36px;
  36. padding: 6px;
  37. background-color: #F00;
  38. color: #333;
  39. }
  40. .slide button {
  41.   margin: .7em 0 0 .7em;
  42.  }
  43. .js #slidebottom .inner {
  44.  display: none;
  45.  }
  46.  </style>
  47.  
  48.  </head>
  49.  
  50. <div id="slideleft" class="slide">
  51.   <button><img src="TestSite/js/fancy_nav_right.png" /></button>
  52.   <div class="inner">Slide from bottom</div>
  53. </div>
  54.  
  55.  
  56.  
  57. <body>
  58. </body>
  59. </html>