Advertisement
pixelsgalore

Untitled

Jul 15th, 2012
806
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.54 KB | None | 0 0
  1. -------------------------------------------------------------
  2. O1. Paste this script after your <head></head> tag.
  3. -------------------------------------------------------------
  4.  
  5.  
  6. <script type="text/javascript"
  7. src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
  8.  
  9. <script>
  10. $(document).ready(function() {
  11. //When you click on a link with class of poplight and the href starts with a #
  12. $('a.poplight[href^=#]').click(function() {
  13. var popID = $(this).attr('rel'); //Get Popup Name
  14. var popURL = $(this).attr('href'); //Get Popup href to define size
  15.  
  16. //Pull Query & Variables from href URL
  17. var query= popURL.split('?');
  18. var dim= query[1].split('&');
  19. var popWidth = dim[0].split('=')[1]; //Gets the first query string value
  20.  
  21. //Fade in the Popup and add close button
  22. $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="http://static.tumblr.com/t0x3if6/GMOlnkeb4/close_window2.png" class="btn_close" title="Close Window" alt="Close" /></a>');
  23.  
  24. //Define margin for center alignment (vertical horizontal) - we add 80px to the height/width to accomodate for the padding and border width defined in the css
  25. var popMargTop = ($('#' + popID).height() + 80) / 2;
  26. var popMargLeft = ($('#' + popID).width() + 80) / 2;
  27.  
  28. //Apply Margin to Popup
  29. $('#' + popID).css({
  30. 'margin-top' : -popMargTop,
  31. 'margin-left' : -popMargLeft
  32. });
  33.  
  34. //Fade in Background
  35. $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
  36. $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies
  37.  
  38. return false;
  39. });
  40.  
  41. //Close Popups and Fade Layer
  42. $('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
  43. $('#fade , .popup_block').fadeOut(function() {
  44. $('#fade, a.close').remove(); //fade them both out
  45. });
  46. return false;
  47. });
  48. });
  49. </script>
  50.  
  51.  
  52.  
  53. <!----------------------------------------------------------------->
  54.  
  55.  
  56. if you want change your popup ''close'' button please
  57. modify this step in your script.
  58.  
  59.  
  60.  
  61. //Fade in the Popup and add close button
  62. $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="NEW BUTTON" class="btn_close" title="Close Window" alt="Close" /></a>');
  63.  
  64.  
  65. change ' new button ' for your new image.
  66.  
  67.  
  68. <!----------------------------------------------------------------->
  69.  
  70. ------------------------------------------------------------------
  71. O2. Paste this config before your </style> tag
  72. ------------------------------------------------------------------
  73.  
  74.  
  75. #fade { /*--Transparent background layer--*/
  76. display: none; /*--hidden by default--*/
  77. background: #000;
  78. position: fixed; left: 0; top: 0;
  79. width: 100%; height: 100%;
  80. opacity: .80;
  81. z-index: 9999;
  82. }
  83. .popup_block{
  84. display: none; /*--hidden by default--*/
  85. background: #fff;
  86. padding: 20px;
  87. border: 20px solid #ddd;
  88. float: left;
  89. font-size: 1.2em;
  90. position: fixed;
  91. top: 50%; left: 50%;
  92. z-index: 99999;
  93. /*--CSS3 Box Shadows--*/
  94. -webkit-box-shadow: 0px 0px 20px #000;
  95. -moz-box-shadow: 0px 0px 20px #000;
  96. box-shadow: 0px 0px 20px #000;
  97. /*--CSS3 Rounded Corners--*/
  98. -webkit-border-radius: 10px;
  99. -moz-border-radius: 10px;
  100. border-radius: 10px;
  101. }
  102. img.btn_close {
  103. float: right;
  104. margin: -50px -50px 0 0;
  105. }
  106. /*--Making IE6 Understand Fixed Positioning--*/
  107. *html #fade {
  108. position: absolute;
  109. }
  110. *html .popup_block {
  111. position: absolute;
  112. }
  113.  
  114. h2{font: 9pt cambria !important; font-weight:normal; line-height:20px; margin:0px; color: #6c9ab0;}
  115.  
  116. <!----------------------------------------------------------------->
  117.  
  118.  
  119. -------------------------------------------
  120. O3. Paste it in your description or where you want to appear.
  121. -------------------------------------------
  122.  
  123.  
  124.  
  125. <a href="#?w=500" rel="YOUR POPUP NAME" class="poplight"> YOUR LINK NAME </a>
  126.  
  127.  
  128. ATTENTION!
  129.  
  130.  
  131. ( "#?w=500" ) = 500 is the size of your pop-up window! change if you want it smaller.
  132.  
  133.  
  134.  
  135. ( EXEMPLE )
  136.  
  137.  
  138. <a href="#?w=500" rel= " faq " class="poplight"> faq </a>
  139.  
  140.  
  141.  
  142. <!----------------------------------------------------------------->
  143.  
  144.  
  145. -------------------------------------------------------------------------------------------------------------------------------
  146. O4. Now attention! in this step you will put the contents of your pop-up that you want to create.
  147. -------------------------------------------------------------------------------------------------------------------------------
  148.  
  149. PASTE THIS BEFORE YOUR {block:Posts} TAG.
  150.  
  151.  
  152.  
  153. <div id="REPEAT YOUR POPUP NAME" class="popup_block">
  154.  
  155. <h2> POPUP MENU TITLE </h2>
  156.  
  157. HERE YOUR CONTENT
  158.  
  159. </div>
  160.  
  161.  
  162.  
  163. ( EXEMPLE )
  164.  
  165.  
  166. <div id=" faq " class="popup_block">
  167.  
  168.  
  169. <h2> MY FAQ </h2>
  170.  
  171.  
  172. How are you :
  173. I'm great.
  174.  
  175.  
  176. </div>
  177.  
  178. <!----------------------------------------------------------------->
  179.  
  180. -------------------------------------
  181. O5. How do i get more pop-up windows?
  182. -------------------------------------
  183.  
  184.  
  185. simple, look :
  186.  
  187.  
  188. O1. just change the commands from your pop-up
  189.  
  190.  
  191. ( EXEMPLE )
  192.  
  193. <a href="#?w=500" rel="ask" class="poplight"> ask </a>
  194. <a href="#?w=500" rel="me" class="poplight"> me </a>
  195. <a href="#?w=500" rel="fav" class="poplight"> about </a>
  196.  
  197.  
  198.  
  199. O2. Now add the contents of each window :
  200.  
  201. ( LOOK )
  202.  
  203.  
  204.  
  205. <!---------------------------- ask ------------------------------------->
  206.  
  207. <div id="ask" class="popup_block">
  208.  
  209. <h2> my ask </h2>
  210.  
  211. <iframe frameborder="0" scrolling="no" width="100%" height="500px" src="http://www.tumblr.com/ask_form/yoururlhere" style="background-color:transparent; overflow:hidden;" id="ask_form"></iframe> <!—[if IE]><script type="text/javascript">document.getElementById('ask_form').allowTransparency=true;</script>
  212.  
  213. </div>
  214.  
  215.  
  216.  
  217. ATTENTION OMG GUYS :
  218.  
  219. change now my url for your url because now all asks are being redirected to my ask box this is strange.
  220.  
  221. <!---------------------------- me ------------------------------------->
  222.  
  223. <div id="me" class="popup_block">
  224.  
  225. <h2> about </h2>
  226.  
  227. i love food, etec etec
  228.  
  229. </div>
  230.  
  231. <!---------------------------- fav ------------------------------------->
  232.  
  233. <div id="fav" class="popup_block">
  234.  
  235. <h2> favorite </h2>
  236.  
  237. here my favorites blog
  238.  
  239. </div>
  240.  
  241. <!---------------------------- END ------------------------------------->
  242.  
  243. PAY ATTENTION :
  244. the script above is important for your ask work in your pop up window!
  245.  
  246.  
  247. <!----------------------------------------------------------------->
  248.  
  249. Tutorial courtesy of http://satan-face.tumblr.com and http://kid-cunt.tumblr.com. c:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement