RishiShreshtha

Untitled

Apr 19th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(document).ready(function () {
  2.     // Fix for the Navigation Button
  3.     jQuery('ul.page-numbers li:last-child a').text('Next');
  4.     jQuery('ul.page-numbers li:first-child a').text('Back');
  5.  
  6.     // Start Mobile Menu //
  7.     if ((jQuery(document).width()) >= 303) {
  8.         jQuery("#toggle_menu").hide();
  9.         jQuery("#mobile-header-wrapper").bind('click', function() {
  10.             jQuery("#toggle_menu").slideToggle(500);
  11.         });
  12.     }
  13.     // Start adjustment of back and next link //
  14.     if ((jQuery(".navnext").text().length) == 17) {
  15.         jQuery(".navnext .next").hide();
  16.         jQuery(".navprev").css({
  17.             "height": "54px",
  18.             "padding-left": "52px",
  19.             "line-height": "54px",
  20.             "background": "url(/wp-content/themes/iamknighted/images/prev.png) no-repeat scroll 22px 20px #363636",
  21.             "font-family": "Futura, Sans-Serif",
  22.             "font-size": "12px",
  23.             "letter-spacing": "2px",
  24.             "text-transform": "uppercase"
  25.         });
  26.     }
  27.     if ((jQuery(".navprev").text().length) == 17) {
  28.         jQuery(".navprev .prev").hide();
  29.         jQuery(".navnext").css({
  30.             "height": "54px",
  31.             "padding-left": "62px",
  32.             "line-height": "54px",
  33.             "background": "url(/wp-content/themes/iamknighted/images/next.png) no-repeat scroll 110px 20px #363636",
  34.             "font-family": "Futura, Sans-Serif",
  35.             "font-size": "12px",
  36.             "letter-spacing": "2px",
  37.             "text-transform": "uppercase"
  38.         });
  39.     }
  40.     // Start To Close Window on Press of Escape Key Header //
  41.     jQuery("#signup_link").bind('click', function() {
  42.         jQuery("body").addClass("blur");
  43.         jQuery(document).keydown(function (event) {
  44.             if (event.keyCode == 27) {
  45.                 jQuery("#mask").hide();
  46.                 jQuery("body").removeClass("blur");
  47.             }
  48.         });
  49.     });
  50.     jQuery("#simplemodal-login").bind('click', function() {
  51.         jQuery("#simplemodal-login-overlay").fadeIn("slow");
  52.         jQuery("body").addClass("blur");
  53.     });
  54.  
  55.     jQuery('#simplemodal-login-overlay').bind('click', function() {
  56.         jQuery(this).hide();
  57.         jQuery("body").removeClass("blur");
  58.     });
  59.     // Start To Disable autoOpen modal window Footer //
  60.     jQuery(".menu-item-150").bind('click', function() {
  61.         jQuery("body").addClass("blur");
  62.         jQuery(document).keypress(function (event) {
  63.             if (event.keyCode == 27) {
  64.                 jQuery("#mask").hide();
  65.                 jQuery("body").removeClass("blur");
  66.             }
  67.         });
  68.     });
  69.     jQuery(".entry-content p").find("img").parent().css("padding", "0");
  70.  
  71.     // Pop Up Window
  72.     // Select All The A Tag With Name Equal To Modal
  73.     jQuery('a[name=modal]').click(function (e) {
  74.         // Cancel The Link Behavior
  75.         e.preventDefault();
  76.  
  77.         // Get The A Tag
  78.         var id = jQuery(this).attr('href');
  79.  
  80.         // Get The Screen Height And Width
  81.         var maskHeight = jQuery(document).height();
  82.         var maskWidth = jQuery(window).width();
  83.  
  84.         // Set Height And Width To Mask To Fill Up The Whole Screen
  85.         jQuery('#mask').css({
  86.             'width': maskWidth,
  87.             'height': maskHeight
  88.         });
  89.  
  90.         // Transition Effect
  91.         jQuery('#mask').fadeIn(1000);
  92.         jQuery('#mask').fadeTo("slow", 0.85);
  93.  
  94.         // Get The Window Height And Width
  95.         var winH = jQuery(window).height();
  96.         var winW = jQuery(window).width();
  97.  
  98.         // Set The Popup Window To Center
  99.         jQuery(id).css('top', winH / 2 - jQuery(id).height() / 2);
  100.         jQuery(id).css('left', winW / 2 - jQuery(id).width() / 2);
  101.  
  102.         // Transition Effect
  103.         jQuery(id).fadeIn(2000);
  104.     });
  105.     // If Close Button Is Clicked
  106.     jQuery('.join-window .close').click(function (e) {
  107.         // Cancel The Link Behavior
  108.         e.preventDefault();
  109.  
  110.         jQuery('#mask').hide();
  111.         jQuery('.join-window').hide();
  112.     });
  113.     // If Mask Is Clicked
  114.     jQuery('#mask').bind('click', function() {
  115.         jQuery(this).hide();
  116.         jQuery('.join-window').hide();
  117.         jQuery("body").removeClass("blur");
  118.     });
  119.     jQuery(window).resize(function () {
  120.         var box = jQuery('#join-box .join-window');
  121.         // Get The Screen Height And Width
  122.         var maskHeight = jQuery(document).height();
  123.         var maskWidth = jQuery(window).width();
  124.  
  125.         // Set Height And Width To Mask To Fill Up The Whole Screen
  126.         jQuery('#mask').css({
  127.             'width': maskWidth,
  128.             'height': maskHeight
  129.         });
  130.  
  131.         // Get The Window Height And Width
  132.         var winH = jQuery(window).height();
  133.         var winW = jQuery(window).width();
  134.  
  135.         // Set The Popup Window To Center
  136.         box.css('top', winH / 2 - box.height() / 2);
  137.         box.css('left', winW / 2 - box.width() / 2);
  138.     });
  139.  
  140.     // For Hiding Content Of Event Post
  141.     jQuery("#event").addClass("event");
  142.     jQuery('article').each(function () {
  143.         len = jQuery('.event').length;
  144.         if (len > 0) {
  145.             jQuery('.event').prev().css("visibility", "hidden");
  146.             jQuery('.event').parent().parent().css('background', '#e24a4a');
  147.             jQuery('.event').parent().prev().css('border', 'none');
  148.             jQuery('.event').next().css("visibility", "hidden");
  149.         }
  150.     });
  151.  
  152.     // For Hiding Current Layer
  153.     jQuery(".simplemodal-register").bind('click', function() {
  154.         jQuery("#join-dialog").hide();
  155.         jQuery("#mask").css("background", "none");
  156.     });
  157.     // End Of For Hiding Current Layer
  158.     // End Of Pop Up Window
  159.     // Start Of Pop Up Window
  160.     jQuery('li#menu-item-150 a').attr('name', 'modal1');
  161.     jQuery('li#menu-item-150 a').attr('href', '#subscribe-dialog');
  162.     //select all the a tag with name equal to modal
  163.     jQuery('a[name=modal1]').click(function (e) {
  164.         //Cancel the link behavior
  165.         e.preventDefault();
  166.  
  167.         //Get the A tag
  168.         var id = jQuery(this).attr('href');
  169.  
  170.         //Get the screen height and width
  171.         var maskHeight = jQuery(document).height();
  172.         var maskWidth = jQuery(window).width();
  173.  
  174.         //Set heigth and width to mask to fill up the whole screen
  175.         jQuery('#subscribe-mask').css({
  176.             'width': maskWidth,
  177.             'height': maskHeight
  178.         });
  179.  
  180.         //transition effect    
  181.         jQuery('#subscribe-mask').fadeIn(1000);
  182.         jQuery('#subscribe-mask').fadeTo("slow", 0.85);
  183.  
  184.         //Get the window height and width
  185.         var winH = jQuery(window).height();
  186.         var winW = jQuery(window).width();
  187.  
  188.         //Set the popup window to center
  189.         jQuery(id).css('top', winH / 2 - jQuery(id).height() / 2);
  190.         jQuery(id).css('left', winW / 2 - jQuery(id).width() / 2);
  191.  
  192.         //transition effect
  193.         jQuery(id).fadeIn(2000);
  194.     });
  195.     //if close button is clicked
  196.     jQuery('.join-window .close').click(function (e) {
  197.         //Cancel the link behavior
  198.         e.preventDefault();
  199.  
  200.         jQuery('#subscribe-mask').hide();
  201.         jQuery('.subscribe-window').hide();
  202.     });
  203.     //if mask is clicked
  204.     jQuery('#subscribe-mask').bind('click', function() {
  205.         jQuery(this).hide();
  206.         jQuery('.subscribe-window').hide();
  207.         jQuery("body").removeClass("blur");
  208.     });
  209.     jQuery(window).resize(function () {
  210.         var box = jQuery('#subscribe-box .subscribe-window');
  211.         //Get the screen height and width
  212.         var maskHeight = jQuery(document).height();
  213.         var maskWidth = jQuery(window).width();
  214.  
  215.         //Set height and width to mask to fill up the whole screen
  216.         jQuery('#subscribe-mask').css({
  217.             'width': maskWidth,
  218.             'height': maskHeight
  219.         });
  220.  
  221.         //Get the window height and width
  222.         var winH = jQuery(window).height();
  223.         var winW = jQuery(window).width();
  224.  
  225.         //Set the popup window to center
  226.         box.css('top', winH / 2 - box.height() / 2);
  227.         box.css('left', winW / 2 - box.width() / 2);
  228.     });
  229.     // End Of Pop Up Window
  230. });
  231.  
  232. // Start Scroll Effect for Menu //
  233. jQuery(document).scroll(function (e) {
  234.     if (((jQuery(window).scrollTop()) >= 0) && ((jQuery(window).scrollTop()) <= 70)) {
  235.         jQuery("#header").stop().animate({
  236.             top: 0
  237.         }, 100);
  238.     } else {
  239.         jQuery("#header").stop().animate({
  240.             top: -97
  241.         }, 500);
  242.     }
  243. });
  244.  
  245. // Script For Facebook
  246.  
  247. function PopupCenter(pageURL, title, w, h) {
  248.     var left = (screen.width / 2) - (w / 2);
  249.     var top = (screen.height / 2) - (h / 2);
  250.     var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
  251. }
  252.  
  253. window.fbAsyncInit = function () {
  254.     FB.init({
  255.         appId: '173504196117106',
  256.         // App ID
  257.         channelUrl: '//www.staging.iamknighted.com/',
  258.         // Channel File
  259.         status: true,
  260.         // check login status
  261.         cookie: true,
  262.         // enable cookies to allow the server to access the session
  263.         xfbml: true // parse XFBML
  264.     });
  265.     // Additional initialization code here
  266. };
  267. // Load the SDK Asynchronously
  268. (function (d) {
  269.     var js, id = 'facebook-jssdk',
  270.         ref = d.getElementsByTagName('script')[0];
  271.     if (d.getElementById(id)) {
  272.         return;
  273.     }
  274.     js = d.createElement('script');
  275.     js.id = id;
  276.     js.async = true;
  277.     js.src = "//connect.facebook.net/en_US/all.js";
  278.     ref.parentNode.insertBefore(js, ref);
  279. }(document));
Advertisement
Add Comment
Please, Sign In to add comment