Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. <div id="timeline-container" class="clearfix">
  2. <div id="timeline-header">
  3. <h1>Header1</h1>
  4. <h3>Header2</h3>
  5. </div>
  6. <div id="timeline-slider"></div>
  7. <ul id="timeline">
  8. <li class="element down">
  9. <img src="http://www.wpclipart.com/blanks/buttons/round/button_round_yellow.png" alt="alt-image">
  10. <h2>Header</h2>
  11. <p>lorem ipsum</p>
  12. </li>
  13. <li class="element down">
  14. <img src="http://www.wpclipart.com/blanks/buttons/round/button_round_yellow.png" alt="alt-image">
  15. <h2>Header</h2>
  16. <p>lorem ipsum</p>
  17. </li>
  18. <li class="element down">
  19. <img src="http://www.wpclipart.com/blanks/buttons/round/button_round_yellow.png" alt="alt-image">
  20. <h2>Header</h2>
  21. <p>lorem ipsum</p>
  22. </li>
  23. <li class="element down">
  24. <img src="http://www.wpclipart.com/blanks/buttons/round/button_round_yellow.png" alt="alt-image">
  25. <h2>Header</h2>
  26. <p>lorem ipsum</p>
  27. </li>
  28. <li class="element down">
  29. <img src="http://www.wpclipart.com/blanks/buttons/round/button_round_yellow.png" alt="alt-image">
  30. <h2>Header</h2>
  31. <p>lorem ipsum</p>
  32. </li>
  33. <li class="element down">
  34. <img src="http://www.wpclipart.com/blanks/buttons/round/button_round_yellow.png" alt="alt-image">
  35. <h2>Header</h2>
  36. <p>lorem ipsum</p>
  37. </li>
  38. <li class="element down">
  39. <img src="http://www.wpclipart.com/blanks/buttons/round/button_round_yellow.png" alt="alt-image">
  40. <h2>Header</h2>
  41. <p>lorem ipsum</p>
  42. </li>
  43. </ul>
  44. </div>
  45.  
  46. .bg-beige {
  47. background: #fff;
  48. }
  49. #timeline-container {
  50. width: 100%;
  51. background: #fff;
  52. overflow: hidden;
  53. margin: 40px auto;
  54. }
  55. #timeline-container #timeline-header {
  56. margin: 0 auto;
  57. z-index: 100;
  58. position: relative;
  59. width: 120px;
  60. top: 15px;
  61. }
  62. #timeline-container #timeline-header h1 {
  63. text-align: center;
  64. }
  65. #timeline-container #timeline-header h3 {
  66. text-align: center;
  67. text-transform: uppercase;
  68. }
  69. #timeline-container #timeline-header h3:before {
  70. position: absolute;
  71. left: -215px;
  72. }
  73. #timeline-container #timeline-header h3:after {
  74. position: absolute;
  75. }
  76. #timeline-container #timeline-slider {
  77. margin: 0 auto;
  78. position: relative;
  79. top: 20px;
  80. width: 650px;
  81. }
  82. #timeline-container #timeline {
  83. display: -webkit-inline-box;
  84. display: -moz-inline-box;
  85. display: -ms-inline-flexbox;
  86. display: -webkit-inline-flex;
  87. display: inline-flex;
  88. -webkit-box-orient: horizontal;
  89. -moz-box-orient: horizontal;
  90. -webkit-box-direction: normal;
  91. -moz-box-direction: normal;
  92. -webkit-flex-direction: row;
  93. -ms-flex-direction: row;
  94. flex-direction: row;
  95. width: auto;
  96. height: 450px;
  97. margin-left: 0;
  98. }
  99. #timeline-container .element {
  100. content: "";
  101. position: relative;
  102. top: 50px;
  103. min-width: 430px;
  104. margin: 0 auto;
  105. }
  106. #timeline-container .element img {
  107. width: 160px;
  108. margin-left: 60px;
  109. }
  110. #timeline-container .element h2 {
  111. margin-left: 115px;
  112. }
  113. #timeline-container .element p {
  114. width: 300px;
  115. text-align: center;
  116. }
  117. #timeline-container .element:last-child {
  118. min-width: 330px;
  119. }
  120. #timeline-container .down {
  121. margin-top: 70px;
  122. }
  123. #timeline-container .no-down {
  124. margin-top: 0;
  125. }
  126.  
  127. $(function () {
  128. var timelineContainer = $("#timeline-container"),
  129. timelineContent = $("#timeline"),
  130. elementContent = $(".element");
  131.  
  132. var scrollbar = $("#timeline-slider").slider({
  133. range: "max",
  134. max: 100,
  135. slide: function (event, ui) {
  136. if (timelineContent.width() > timelineContainer.width()) {
  137. timelineContent.css("margin-left", Math.round(
  138. ui.value / 100 * (timelineContainer.width() - timelineContent.width())
  139. ) + "px");
  140. } else {
  141. timelineContent.css("margin-left", 0, "padding", 0, "left", 0);
  142. }
  143. }
  144. });
  145.  
  146.  
  147. timelineContainer.css("overflow", "hidden");
  148.  
  149. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement