Advertisement
iamthemelocked

Iamthemelocked - Updates Tab #14 Part 1

Oct 11th, 2014
1,060
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. <!--- POP UP STUFF --->
  2.  
  3. <script>
  4. $(document).ready(function() {
  5. //
  6. //When you click on a link with class of poplight and the href starts with a #
  7. $('a.poplight[href^=#]').click(function() {
  8. var popID = $(this).attr('rel'); //Get Popup Name
  9. var popURL = $(this).attr('href'); //Get Popup href to define size
  10. //Pull Query & Variables from href URL
  11. var query= popURL.split('?');
  12. var dim= query[1].split('&');
  13. var popWidth = dim[0].split('=')[1]; //Gets the first query string value
  14. //Fade in the Popup and add close button
  15. $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><class="btn_close" title="Close Window" alt="Close" /></a>');
  16. //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
  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. //Fade in Background
  25. $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
  26. $('#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
  27. return false;
  28. });
  29. //Close Popups and Fade Layer
  30. $('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
  31. $('#fade , .popup_block').fadeOut(function() {
  32. $('#fade, a.close').remove(); //fade them both out
  33. });
  34. return false;
  35. });
  36. });
  37. </script>
  38.  
  39. <!--- POP UP STUFF --->
  40.  
  41. <!--- UPDATES TAB COLOURS --->
  42.  
  43. <meta name="color:Tab Text Colour" content="#000000"/>
  44. <meta name="color:Tab Links Colour" content="#b6b6b6"/>
  45. <meta name="color:Tab Links Colour Hover" content="#000000"/>
  46.  
  47. <meta name="color:Tab Square 1 Colour" content="#000000"/>
  48. <meta name="color:Tab Square 2 Colour" content="#991012"/>
  49. <meta name="color:Tab Square 3 Colour" content="#000000"/>
  50. <meta name="color:Tab Square 4 Colour" content="#991012"/>
  51.  
  52. <!--- UPDATES TAB COLOURS --->
  53.  
  54. <!---UPDATES TAB ON/OFF --->
  55.  
  56. <meta name="if:Updates Tab" content="1"/>
  57.  
  58. <!---UPDATES TAB ON/OFF --->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement