What does jquery.parallax do?

jParallax turns nodes into absolutely positioned layers that move in response to the mouse. Depending on their dimensions these layers move in a parallaxy kind of way.

layer

To see layers through a viewport, wrap them in a container with the style,
  1. <ul>
  2. <li class=” parallax-layer”></li>
  3. <li class=” parallax-layer”></li>
  4. </ul>
CSS:
  1. #content
  2. {
  3. background - color: #FFFFFF;
  4. text - align: left;
  5. padding: 0 px;
  6. }
  7. h1
  8. {
  9. padding: 20 px;
  10. background - color: gray;
  11. color: white;
  12. margin: 0;
  13. text - shadow: #9E9B9B 2px 2px 2px;
  14. text-align: center;
  15. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr= '#E3E1E1',
  16. endColorstr = '#CCCACA'); /* for IE */
  17. background: -webkit - gradient(linear, left top, left bottom, from(#E3E1E1), to(#CCCACA)); /* for webkit browsers */
  18. background: -moz - linear - gradient(top, #E3E1E1, #CCCACA); /* for firefox 3.6+ */
  19. }
  20. .large
  21. {
  22. font - size: 22 px;
  23. }
  24. .orange
  25. {
  26. color: orange;
  27. }
  28. .italic
  29. {
  30. font - style: italic;
  31. }
  32. .textmiddle
  33. {
  34. vertical - align: middle;
  35. }
  36. .padout
  37. {
  38. padding - left: 25 px;
  39. padding - right: 25 px;
  40. }
  41. .rounded - corners
  42. {
  43. -moz - border - radius: 40 px; - webkit - border - radius: 40 px; - khtml - border - radius: 40 px;
  44. border - radius: 40 px;
  45. }
  46. .rounded - corners - top
  47. {
  48. -moz - border - top - radius: 40 px; - webkit - border - radius: 40 px; - khtml - border - radius: 40 px;
  49. border - radius: 40 px;
  50. }
  51. h2
  52. {
  53. color: blue;
  54. font - size: 22 px;
  55. color: white;
  56. background - color: gray;
  57. padding: 10 px 10 px 10 px 20 px; - moz - border - radius: 40 px; - webkit - border - radius: 40 px; - khtml - border - radius: 40 px;
  58. border - radius: 40 px;
  59. text - shadow: #9E9B9B 2px 2px 2px;
  60. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr= '#E3E1E1',
  61. endColorstr = '#CCCACA'); /* for IE */
  62. background: -webkit - gradient(linear, left top, left bottom, from(#E3E1E1), to(#CCCACA)); /* for webkit browsers */
  63. background: -moz - linear - gradient(top, #E3E1E1, #CCCACA); /* for firefox 3.6+ */
  64. }
  65. p {
  66. margin: 20 px!important;
  67. }
  68. .scrolldown
  69. {
  70. padding - left: 20 px;
  71. color: #EDECE8;
  72. font - size: 40 px;
  73. font - weight: bold;
  74. vertical - align: middle;
  75. text - shadow: #6374AB 2px 2px 2px;
  76. }
  77. # page - wrap
  78. {
  79. border: 1 px solid orange;
  80. margin: 10 px auto;
  81. /*width: 950px;*/
  82. }
  83. #parallax - header
  84. {
  85. height: 200 px;
  86. background - color: gray;
  87. }
  88. #parallax
  89. {
  90. position: relative;
  91. overflow: hidden;
  92. height: 506 px;
  93. width: 1348 px;
  94. background - image: url('images/1.jpg');
  95. }
  96. .parallax - viewport
  97. {
  98. position: relative; /* relative, absolute, fixed */
  99. overflow: hidden;
  100. }
  101. .parallax - layer
  102. {
  103. position: absolute;
  104. }
HTML:

Put different slices of images in different containers. Set height and width of them accordingly.
  1. <div id="parallax" class="clear">
  2. <div class="parallax-layer" style="width:1002px; height:509px;">
  3. <img src="images/2.png" alt="" style="width:1002px; height:509px;" />
  4. </div>
  5. </div>
JQuery:

Code for detecting mouse moment. According to mouse moment picture moves.
  1. <script type="text/javascript">
  2. jQuery(document).ready(function()
  3. {
  4. $('#parallax .parallax-layer')
  5. .parallax
  6. ({
  7. mouseport: $('#parallax')
  8. });
  9. });
  10. </script>
Herewith I am attaching source code. Please refer it for further reference.