Advertisement
teruteru

School Idol Festival -【 POPUP LAYOUT 1 by Anomaly ☽】

Dec 17th, 2017
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.54 KB | None | 0 0
  1. #1 - paste these where your scripts are (do not play with the scripts unless you know what you are doing)
  2.  
  3. <link href="https://use.fontawesome.com/releases/v5.0.1/css/all.css" rel="stylesheet"> /*-- https://fontawesome.com/icons?d=gallery&m=free font awesome cheatsheet --*/
  4.  
  5. <script type="text/javascript"
  6. src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
  7. <script>
  8. $(document).ready(function() {
  9. //
  10. $('a.poplight[href^=#]').click(function() {
  11. var popID = $(this).attr('rel'); //Get Popup Name
  12. var popURL = $(this).attr('href'); //Get Popup href to define size
  13. var query= popURL.split('?');
  14. var dim= query[1].split('&');
  15. var popWidth = dim[0].split('=')[1]; //Gets the first query string value
  16. $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close">x</a>');
  17. var popMargTop = ($('#' + popID).height() + 80) / 2;
  18. var popMargLeft = ($('#' + popID).width() + 80) / 2;
  19. //Apply Margin to Popup
  20. $('#' + popID).css({
  21. 'margin-top' : -popMargTop,
  22. 'margin-left' : -popMargLeft
  23. });
  24. $('body').append('<div id="fade"></div>');
  25. $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'})
  26. return false;
  27. });
  28. $('a.close, #fade').live('click', function() {
  29. $('#fade , .popup_block').fadeOut(function() {
  30. $('#fade, a.close').remove(); //fade them both out
  31. });
  32. return false;
  33. });
  34. });
  35. </script>
  36.  
  37. /*------------------------------------------------------------------------------------------------------*/
  38.  
  39. #2 - paste this between <style type="text/css"> and </style></head><body>
  40.  
  41. #fade { /*--Transparent background layer--*/
  42. display:none; /*--hidden by default; do not change--*/
  43. background:#000;
  44. background-image:url('');
  45. position:fixed;
  46. left:0;
  47. top:0;
  48. width:100%;
  49. height:100%;
  50. opacity:.80;
  51. z-index:9999;
  52. }
  53.  
  54. .popup_block{
  55. display:none; /*--hidden by default; do not change--*/
  56. background:#fff;
  57. background-image:url('https://orig00.deviantart.net/70c9/f/2017/350/6/7/vo8wes0_by_kittystuff-dbwyjlr.png');
  58. padding:14px;
  59. border:2px solid #aaa;
  60. box-shadow:0 0 0 2px #fff;
  61. border-radius:20px;
  62. float:left;
  63. font-size:1em; /*--feel free to change this--*/
  64. position:fixed;
  65. top:50%;
  66. left:50%;
  67. z-index:99999;
  68. }
  69.  
  70. .close {
  71. position:absolute;
  72. right:2px;
  73. top:2px;
  74. width:40px;
  75. height:40px;
  76. padding:1px;
  77. background:#ff77aa;
  78. border:2px solid #fff;
  79. color:#fff;
  80. border-radius:40px;
  81. box-shadow:1px 2px 2px 0px rgba(0, 0, 0, 0.5);
  82. text-align:center;
  83. line-height:35px;
  84. font-size:30px;
  85. font-weight:bold;
  86. }
  87.  
  88. /*--Making IE6 Understand Fixed Positioning--*/
  89. *html #fade {
  90. position:absolute;
  91. }
  92.  
  93. *html .popup_block {
  94. position:absolute;
  95. }
  96.  
  97.  
  98. /*--------------------------------------------------*/
  99.  
  100. a.link {
  101. display:inline-block;
  102. width:232px;
  103. padding:11px;
  104. color:#fff;
  105. background:#ff6699;
  106. border:2px solid #fff;
  107. box-shadow:1px 1px 1px 0px rgba(0, 0, 0, 0.75);
  108. margin:12px;
  109. border-radius:20px;
  110. }
  111.  
  112. /*------------------------------------------------------------------------------------------------------*/
  113.  
  114. #3 - replace one of your links with this
  115.  
  116. <a href="#?w=900" rel="nav" class="poplight">[TITLE HERE]</a>
  117.  
  118. /*------------------------------------------------------------------------------------------------------*/
  119.  
  120. #4 - paste this between </body> and </html>
  121.  
  122. <div id="nav" class="popup_block">
  123.  
  124. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  125. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  126. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  127.  
  128. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  129. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  130. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  131.  
  132. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  133. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  134. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  135.  
  136. <a class="link" href="/"><i class="fa fa-circle"></i> examples</a>
  137. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  138. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  139.  
  140. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  141. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  142. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  143.  
  144. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  145. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  146. <a class="link" href="/"><i class="fa fa-circle"></i> example</a>
  147.  
  148. </div></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement