Guest User

Untitled

a guest
Jun 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. <div class="boardshot_list">
  2. {% for ... %}
  3.  
  4. <span class="img_box">
  5. <a href="/site_media/xxx" target="_blank">
  6. <img class="trigger" src="xxx" alt="{{ item.title }}" />
  7. </a>
  8.  
  9. <div class="container_speech_box popup">
  10. <div class="two">
  11. <b class="tl"><b class="tr"></b></b>
  12. <p>
  13. blabla
  14. </p>
  15. <b class="bl"></b><b class="br"><b class="point"></b></b>
  16. </div>
  17. </div>
  18.  
  19. </span>
  20.  
  21.  
  22. {% endfor %}
  23.  
  24. </div>
  25.  
  26. div.boardshot_list span.img_box {
  27. display:block;
  28. width:220px;
  29. height:180px;
  30. float: left;
  31. margin: 0 10px 10px 0;
  32. position: relative;
  33. }
  34. img.trigger{
  35. border:1px solid #373743;
  36. }
  37. div.popup
  38. {
  39. display: none;
  40. position: absolute;
  41. z-index: 50;
  42. }
  43.  
  44. /* POPUP rounded box */
  45. .container_speech_box div:after {content: "."; display: block; height:11px; clear:both; visibility:hidden;}
  46. .container_speech_box div {width:300px; height:auto; font-family:verdana; font-size:11px;}
  47. b.tl {display:block; width:300px; height:8px; font-size:1px;}
  48. b.tr {display:block; width:292px; height:8px; font-size:1px; float:right;}
  49. b.bl {display:block; width:8px; height:8px; font-size:1px; float:left;}
  50. b.br {display:block; width:292px; height:8px; font-size:1px; float:right; position:relative;}
  51. b.point {display:block; font-size:1px; width:25px; height:14px;}
  52. .container_speech_box div p {padding:8px; margin:0; border:3px solid #4f5b69; border-width:0 3px; text-align:justify;}
  53.  
  54.  
  55.  
  56.  
  57. div.two b.tl {background:url(/site_media/images/top_left2.gif) top left no-repeat;}
  58. div.two b.tr {background:url(/site_media/images/top_right2.gif) top right no-repeat;}
  59. div.two p {background:#fff;}
  60. div.two b.bl {background:url(/site_media/images/bottom_left2.gif) top left no-repeat;}
  61. div.two b.br {background:url(/site_media/images/bottom_right2.gif) top right no-repeat;}
  62. div.two b.point {background:url(/site_media/images/point2.gif) top left no-repeat; margin:5px 0 0 125px;}
  63.  
  64.  
  65. /* end popup table */
  66.  
  67. div.boardshot_list {
  68. width: 700px;
  69. clear: left;
  70. min-height: 80px;
  71.  
  72. }
  73. div.boardshot_list .memo_id {
  74. padding-left: 10px;
  75. position: relative;
  76. float:right;
  77. color:#60564d;
  78. font-size: 25px;
  79. padding-top: 20px;
  80. width: 50px;
  81. top: 30px;
  82. left: 10px;
  83. font-family:"Palatino Linotype","Book Antiqua",Palatino,FreeSerif,serif;
  84. }
  85.  
  86. div.boardshot_list.even {
  87. background-color: #f3f5f6;
  88.  
  89. }
  90.  
  91. div.boardshot_list .title span{
  92. color: #bbb;
  93. font-weight: normal;
  94. }
  95.  
  96. div.boardshot_list .img img {
  97. border:1px solid #373743;
  98. }
  99.  
  100. <script type="text/javascript">
  101. $(document).ready(function(){
  102.  
  103. $('.img_box').each(function () {
  104. // options
  105. var distance = 10;
  106. var time = 250;
  107. var hideDelay = 50;
  108. var hideDelayTimer = null;
  109.  
  110. // tracker
  111. var beingShown = false;
  112. var shown = false;
  113.  
  114. var trigger = $('.trigger', this);
  115. var popup = $('.popup', this).css('opacity', 0);
  116.  
  117. // set the mouseover and mouseout on both element
  118. $([trigger.get(0), popup.get(0)]).mouseover(function () {
  119. // stops the hide event if we move from the trigger to the popup element
  120. if (hideDelayTimer) clearTimeout(hideDelayTimer);
  121.  
  122. // don't trigger the animation again if we're being shown, or already visible
  123. if (beingShown || shown) {
  124. return;
  125. } else {
  126. beingShown = true;
  127. // reset position of popup box
  128. popup.css({
  129. top: -10,
  130. left: 20,
  131. display: 'block' // brings the popup back in to view
  132. })
  133.  
  134. // (we're using chaining on the popup) now animate it's opacity and position
  135. .animate({
  136. top: '-=' + distance + 'px',
  137. opacity: 0.9
  138. }, time, 'swing', function() {
  139. // once the animation is complete, set the tracker variables
  140. beingShown = false;
  141. shown = true;
  142. });
  143. }
  144. }).mouseout(function () {
  145. // reset the timer if we get fired again - avoids double animations
  146. if (hideDelayTimer) clearTimeout(hideDelayTimer);
  147.  
  148. // store the timer so that it can be cleared in the mouseover if required
  149. hideDelayTimer = setTimeout(function () {
  150. hideDelayTimer = null;
  151. popup.animate({
  152.  
  153. opacity: 0
  154. }, time, 'swing', function () {
  155. shown = false;
  156. popup.css('display', 'none');
  157. });
  158. }, hideDelay);
  159. });
  160. });
  161. });
  162.  
  163.  
  164. </script>
  165.  
  166. // reset position of popup box
  167. popup.css({
  168. top: -10,
  169. left: 20,
  170. display: 'block' // brings the popup back in to view
  171. })
  172.  
  173. $(this).css('z-index', '1');
Add Comment
Please, Sign In to add comment