Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. <body>
  2. <section id="pics" class="clearfix">
  3. <figure
  4. id="pic1"
  5. class="pictures"
  6. >
  7. <img
  8. alt="figure1"
  9. src="http://b-i.forbesimg.com/kellyclay/files/2013/12/glass.jpg"
  10. title="pic1"
  11. >
  12. <figcaption class="figuredetails">Fig1</figcaption>
  13.  
  14. </figure>
  15.  
  16.  
  17. <figure
  18. id="pic2"
  19. class="pictures"
  20. >
  21. <img
  22. alt="figure2"
  23. src="http://glass-apps.org/wp-content/uploads/2013/06/google-glass1.jpg"
  24. title="pic2"
  25. >
  26. <figcaption class="figuredetails">Fig2</figcaption>
  27.  
  28. </figure>
  29. </section>
  30. <section id="content">
  31. <p>hello</p>
  32. </section>
  33. </body>
  34.  
  35. @CHARSET "UTF-8";
  36.  
  37. #pics{
  38.  
  39. width:100%;
  40. padding: 50px 50px;
  41. }
  42.  
  43. .pictures{
  44. float: left;
  45. width:200px;
  46. height:200px;
  47. box-shadow: 10px 10px 5px #888888;
  48. }
  49.  
  50.  
  51.  
  52. .pictures img{
  53. width:100%;
  54. height:auto;
  55.  
  56.  
  57.  
  58. }
  59.  
  60. #pic1{
  61.  
  62. -ms-transform: rotate(30deg);
  63. -webkit-transform: rotate(30deg);
  64. transform: rotate(30deg);
  65. z-index: -1
  66. }
  67.  
  68.  
  69. #pic2{
  70. position: absolute;
  71. -ms-transform: rotate(50deg);
  72. -webkit-transform: rotate(50deg);
  73. transform: rotate(50deg);
  74. /* z-index: -2; */
  75.  
  76. }
  77.  
  78. #content{
  79. clear: both;
  80. }
  81.  
  82. .pictures > .figuredetails{
  83. color: red;
  84. padding-left: 20px;
  85. }
  86.  
  87. .clearfix:after {
  88. content: ".";
  89. visibility: hidden;
  90. display: block;
  91. height: 0;
  92. clear: both;
  93. }
  94.  
  95. function pichoverfunc() {
  96. $(this).css({"z-index":10});
  97. }
  98.  
  99. function pichoverfuncO() {
  100. $(this).css({"z-index":-10});
  101. }
  102.  
  103.  
  104. $(document).ready(
  105.  
  106. $("#pic2").hover(pichoverfunc, pichoverfuncO)
  107. );
  108.  
  109. #pic2{
  110. position: absolute;
  111. -ms-transform: rotate(50deg);
  112. -webkit-transform: rotate(50deg);
  113. transform: rotate(50deg);
  114. /* z-index: -2; */
  115.  
  116. }
  117.  
  118. #pic2:hover{
  119. z-index:10;
  120. }
  121.  
  122. .img-hover:hover{
  123. z-index:10;
  124. }
  125.  
  126. img:hover{
  127. ...
  128. }
  129.  
  130. <body>
  131. <img
  132. id="pic1"
  133. alt="figure1"
  134. src="http://b-i.forbesimg.com/kellyclay/files/2013/12/glass.jpg"
  135. title="pic1"
  136. >
  137. <img
  138. id="pic2"
  139. alt="figure2"
  140. src="http://glass-apps.org/wp-content/uploads/2013/06/google-glass1.jpg"
  141. title="pic2"
  142. >
  143. </body>
  144.  
  145. function handlerIn() {
  146. $('img').css({"z-index": -10}); //Push all images back
  147. $(this).css({"z-index": 10}); //Bring our target to front
  148. }
  149.  
  150. function handlerOut() {
  151. $('img').css({"z-index": 10}); //Bring all our images to front
  152. $(this).css({"z-index": -10}); //Push target back
  153. }
  154.  
  155. $(document).ready(function(){
  156. $("img").hover(handlerIn, handlerOut);
  157. });
  158.  
  159. img {
  160. position: relative;
  161. width:200px;
  162. height:200px;
  163. box-shadow: 10px 10px 5px #888888;
  164. }
  165.  
  166. #pic1{
  167. -ms-transform: rotate(30deg);
  168. -webkit-transform: rotate(30deg);
  169. transform: rotate(30deg);
  170. }
  171.  
  172. #pic2{
  173. -ms-transform: rotate(50deg);
  174. -webkit-transform: rotate(50deg);
  175. transform: rotate(50deg);
  176. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement