laeverdeens

Navigation 02

Feb 5th, 2013
15,031
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. JAVASCRIPT CODE: PASTE THIS BELOW <HEAD> AND NOWHERE ELSE-OR IT WON'T WORK
  2.  
  3. <script type="text/javascript"
  4. src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
  5.  
  6. <script>
  7.  
  8.  
  9.  
  10. $(document).ready(function() {
  11.  
  12. //
  13.  
  14.  
  15.  
  16. //When you click on a link with class of poplight and the href starts with a #
  17.  
  18. $('a.poplight[href^=#]').click(function() {
  19.  
  20. var popID = $(this).attr('rel'); //Get Popup Name
  21.  
  22. var popURL = $(this).attr('href'); //Get Popup href to define size
  23.  
  24.  
  25.  
  26. //Pull Query & Variables from href URL
  27.  
  28. var query= popURL.split('?');
  29.  
  30. var dim= query[1].split('&');
  31.  
  32. var popWidth = dim[0].split('=')[1]; //Gets the first query string value
  33.  
  34.  
  35.  
  36. //Fade in the Popup and add close button
  37.  
  38. $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="http://tiny.cc/closeimg" class="btn_close" title="Close Window" alt="Close" /></a>');
  39.  
  40.  
  41. //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
  42.  
  43. var popMargTop = ($('#' + popID).height() + 80) / 2;
  44.  
  45. var popMargLeft = ($('#' + popID).width() + 80) / 2;
  46.  
  47.  
  48.  
  49. //Apply Margin to Popup
  50.  
  51. $('#' + popID).css({
  52.  
  53. 'margin-top' : -popMargTop,
  54.  
  55. 'margin-left' : -popMargLeft
  56.  
  57. });
  58.  
  59.  
  60.  
  61. //Fade in Background
  62.  
  63. $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
  64.  
  65. $('#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
  66.  
  67.  
  68.  
  69. return false;
  70.  
  71. });
  72.  
  73.  
  74.  
  75. //Close Popups and Fade Layer
  76.  
  77. $('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
  78.  
  79. $('#fade , .popup_block').fadeOut(function() {
  80.  
  81. $('#fade, a.close').remove(); //fade them both out
  82.  
  83. });
  84.  
  85. return false;
  86.  
  87. });
  88.  
  89.  
  90.  
  91.  
  92.  
  93. });
  94.  
  95. </script>
  96.  
  97. THIS PART GOES AFTER <style>
  98.  
  99. #fade {
  100. display: none;
  101. background: #000;
  102. position: fixed;
  103. left: 0;
  104. top: 0;
  105. width: 100%;
  106. height: 100%;
  107. opacity: .80;
  108. z-index: 9999;
  109. }
  110.  
  111. .popup_block{
  112. display: none;
  113. background: #FFFFFF;
  114. padding: 55px;
  115. float: left; height: 50%; color: #313131;
  116. position: fixed;
  117. top: 50%; overflow-y: auto; overflow-x: no scroll;
  118. left: 50%;
  119. z-index: 99999;
  120. }
  121.  
  122. img.btn_close {
  123. float: right;
  124. margin: -55px -55px 0 0; opacity: 0;
  125. }
  126.  
  127.  
  128. #continue {
  129. margin-top:10px;
  130. }
  131.  
  132. #titless { display:inline-block;
  133. background-color:#94adac;
  134. width:230px; font-family: calibri;
  135. padding:5px;
  136. color:#ffffff;
  137. letter-spacing:2px;
  138. font-size:8px;
  139. text-transform:uppercase;
  140. text-align:center; }
  141.  
  142. #continue a {
  143. display:inline-block;
  144. background-color:#94adac;
  145. width:70px; font-family: calibri;
  146. padding:5px;
  147. color:#ffffff;
  148. letter-spacing:2px;
  149. font-size:8px;
  150. text-transform:uppercase;
  151. text-align:center;
  152. border-bottom:2px solid transparent;
  153. -webkit-transition: all 0.3s ease-in-out;
  154. -moz-transition: all 0.3s ease-in-out;
  155. transition: all 0.3s ease-in-out;
  156. }
  157.  
  158. .links2 { font-family: cambria; font-size: 10px; font-style:italic; letter-spacing:2px; color: #8b8888;text-transform: lowercase; }
  159.  
  160. .links2 a { display: block; text-align:center;padding: 10px; margin: 5px;color:#fff; font-style:italic; letter-spacing:2px; color: #8b8888; border-bottom: 1px solid #f1f1f1;}
  161.  
  162.  
  163. THE LINK; THIS GOES AROUND THE LINK YOU WANT TO SHOW IT UP AS. IN THE PREVIEW, I USED NAVIGATION. YOU'RE GOING TO HAVE TO FIND THE LINKS OF YOUR THEME IN THE HTML TO BE ABLE TO DO THIS. (I'D SEARCH /ASK IN CTRL+F OR LINKS) OR YOU COULD JUST PASTE THIS IN YOUR DESCRIPTION.
  164.  
  165. <a href="#?w=500" rel="TES" class="poplight">navigation </a>
  166.  
  167.  
  168. NOW, THE LINKS PART. YOU CAN PASTE THIS ANYWHERE AFTER BODY. IF YOU'D LIKE TO ADD MORE LINKS, JUST COPY THE CODE BETWEEN (AND INCLUDING) <TABLE> and </TABLE>
  169.  
  170. <div id="TES" class="popup_block">
  171.  
  172. <table><td>
  173.  
  174. <div id="titless">TITLE HERE</a></div>
  175.  
  176. <div class="links2">
  177.  
  178. <a href="/">Tag One</a>
  179.  
  180. <a href="/">Tag Two</a>
  181.  
  182. <a href="/">Tag Three</a>
  183.  
  184. <a href="/">Tag Four</a>
  185.  
  186. <a href="/">Tag Five</a>
  187.  
  188. <a href="/">Tag Six</a>
  189.  
  190. <a href="/">Tag Seven</a>
  191.  
  192. </div> </td><td> <div id="titless">TITLE HERE</a></div>
  193.  
  194. <div class="links2">
  195.  
  196. <a href="/">Tag One</a>
  197.  
  198. <a href="/">Tag Two</a>
  199.  
  200. <a href="/">Tag Three</a>
  201.  
  202. <a href="/">Tag Four</a>
  203.  
  204. <a href="/">Tag Five</a>
  205.  
  206. <a href="/">Tag Six</a>
  207.  
  208. <a href="/">Tag Seven</a>
  209.  
  210. </div>
  211. </td></table>
  212.  
  213.  
  214. <div id="continue"><center><a href="/">go home</a></div> <center><a href="http://claraosmin.tumblr.com/">credit </a>
  215. </div>
Advertisement
Add Comment
Please, Sign In to add comment