Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function () {
- // Fix for the Navigation Button
- jQuery('ul.page-numbers li:last-child a').text('Next');
- jQuery('ul.page-numbers li:first-child a').text('Back');
- // Start Mobile Menu //
- if ((jQuery(document).width()) >= 303) {
- jQuery("#toggle_menu").hide();
- jQuery("#mobile-header-wrapper").click(function () {
- jQuery("#toggle_menu").slideToggle(500);
- });
- }
- // Start adjustment of back and next link //
- if ((jQuery(".navnext").text().length) == 17) {
- jQuery(".navnext .next").hide();
- jQuery(".navprev").css({
- "height": "54px",
- "padding-left": "52px",
- "line-height": "54px",
- "background": "url(/wp-content/themes/iamknighted/images/prev.png) no-repeat scroll 22px 20px #363636",
- "font-family": "Futura, Sans-Serif",
- "font-size": "12px",
- "letter-spacing": "2px",
- "text-transform": "uppercase"
- });
- }
- if ((jQuery(".navprev").text().length) == 17) {
- jQuery(".navprev .prev").hide();
- jQuery(".navnext").css({
- "height": "54px",
- "padding-left": "62px",
- "line-height": "54px",
- "background": "url(/wp-content/themes/iamknighted/images/next.png) no-repeat scroll 110px 20px #363636",
- "font-family": "Futura, Sans-Serif",
- "font-size": "12px",
- "letter-spacing": "2px",
- "text-transform": "uppercase"
- });
- }
- // Start To Close Window on Press of Escape Key Header //
- jQuery("#signup_link").click(function () {
- jQuery("body").addClass("blur");
- jQuery(document).keydown(function (event) {
- if (event.keyCode == 27) {
- jQuery("#mask").hide();
- jQuery("body").removeClass("blur");
- }
- });
- });
- jQuery("#simplemodal-login").click(function () {
- jQuery("#simplemodal-login-overlay").fadeIn("slow");
- jQuery("body").addClass("blur");
- });
- jQuery('#simplemodal-login-overlay').click(function () {
- jQuery(this).hide();
- jQuery("body").removeClass("blur");
- });
- // Start To Disable autoOpen modal window Footer //
- jQuery(".menu-item-150").click(function () {
- jQuery("body").addClass("blur");
- jQuery(document).keypress(function (event) {
- if (event.keyCode == 27) {
- jQuery("#mask").hide();
- jQuery("body").removeClass("blur");
- }
- });
- });
- jQuery(".entry-content p").find("img").parent().css("padding", "0");
- // Pop Up Window
- // Select All The A Tag With Name Equal To Modal
- jQuery('a[name=modal]').click(function (e) {
- // Cancel The Link Behavior
- e.preventDefault();
- // Get The A Tag
- var id = jQuery(this).attr('href');
- // Get The Screen Height And Width
- var maskHeight = jQuery(document).height();
- var maskWidth = jQuery(window).width();
- // Set Height And Width To Mask To Fill Up The Whole Screen
- jQuery('#mask').css({
- 'width': maskWidth,
- 'height': maskHeight
- });
- // Transition Effect
- jQuery('#mask').fadeIn(1000);
- jQuery('#mask').fadeTo("slow", 0.85);
- // Get The Window Height And Width
- var winH = jQuery(window).height();
- var winW = jQuery(window).width();
- // Set The Popup Window To Center
- jQuery(id).css('top', winH / 2 - jQuery(id).height() / 2);
- jQuery(id).css('left', winW / 2 - jQuery(id).width() / 2);
- // Transition Effect
- jQuery(id).fadeIn(2000);
- });
- // If Close Button Is Clicked
- jQuery('.join-window .close').click(function (e) {
- // Cancel The Link Behavior
- e.preventDefault();
- jQuery('#mask').hide();
- jQuery('.join-window').hide();
- });
- // If Mask Is Clicked
- jQuery('#mask').click(function () {
- jQuery(this).hide();
- jQuery('.join-window').hide();
- jQuery("body").removeClass("blur");
- });
- jQuery(window).resize(function () {
- var box = jQuery('#join-box .join-window');
- // Get The Screen Height And Width
- var maskHeight = jQuery(document).height();
- var maskWidth = jQuery(window).width();
- // Set Height And Width To Mask To Fill Up The Whole Screen
- jQuery('#mask').css({
- 'width': maskWidth,
- 'height': maskHeight
- });
- // Get The Window Height And Width
- var winH = jQuery(window).height();
- var winW = jQuery(window).width();
- // Set The Popup Window To Center
- box.css('top', winH / 2 - box.height() / 2);
- box.css('left', winW / 2 - box.width() / 2);
- });
- // For Hiding Content Of Event Post
- jQuery("#event").addClass("event");
- jQuery('article').each(function () {
- len = jQuery('.event').length;
- if (len > 0) {
- jQuery('.event').prev().css("visibility", "hidden");
- jQuery('.event').parent().parent().css('background', '#e24a4a');
- jQuery('.event').parent().prev().css('border', 'none');
- jQuery('.event').next().css("visibility", "hidden");
- }
- });
- // For Hiding Current Layer
- jQuery(".simplemodal-register").click(function () {
- jQuery("#join-dialog").hide();
- jQuery("#mask").css("background", "none");
- });
- // End Of For Hiding Current Layer
- // End Of Pop Up Window
- // Start Of Pop Up Window
- jQuery('li#menu-item-150 a').attr('name', 'modal1');
- jQuery('li#menu-item-150 a').attr('href', '#subscribe-dialog');
- //select all the a tag with name equal to modal
- jQuery('a[name=modal1]').click(function (e) {
- //Cancel the link behavior
- e.preventDefault();
- //Get the A tag
- var id = jQuery(this).attr('href');
- //Get the screen height and width
- var maskHeight = jQuery(document).height();
- var maskWidth = jQuery(window).width();
- //Set heigth and width to mask to fill up the whole screen
- jQuery('#subscribe-mask').css({
- 'width': maskWidth,
- 'height': maskHeight
- });
- //transition effect
- jQuery('#subscribe-mask').fadeIn(1000);
- jQuery('#subscribe-mask').fadeTo("slow", 0.85);
- //Get the window height and width
- var winH = jQuery(window).height();
- var winW = jQuery(window).width();
- //Set the popup window to center
- jQuery(id).css('top', winH / 2 - jQuery(id).height() / 2);
- jQuery(id).css('left', winW / 2 - jQuery(id).width() / 2);
- //transition effect
- jQuery(id).fadeIn(2000);
- });
- //if close button is clicked
- jQuery('.join-window .close').click(function (e) {
- //Cancel the link behavior
- e.preventDefault();
- jQuery('#subscribe-mask').hide();
- jQuery('.subscribe-window').hide();
- });
- //if mask is clicked
- jQuery('#subscribe-mask').click(function () {
- jQuery(this).hide();
- jQuery('.subscribe-window').hide();
- jQuery("body").removeClass("blur");
- });
- jQuery(window).resize(function () {
- var box = jQuery('#subscribe-box .subscribe-window');
- //Get the screen height and width
- var maskHeight = jQuery(document).height();
- var maskWidth = jQuery(window).width();
- //Set height and width to mask to fill up the whole screen
- jQuery('#subscribe-mask').css({
- 'width': maskWidth,
- 'height': maskHeight
- });
- //Get the window height and width
- var winH = jQuery(window).height();
- var winW = jQuery(window).width();
- //Set the popup window to center
- box.css('top', winH / 2 - box.height() / 2);
- box.css('left', winW / 2 - box.width() / 2);
- });
- // End Of Pop Up Window
- });
- // Start Scroll Effect for Menu //
- jQuery(document).scroll(function (e) {
- if (((jQuery(window).scrollTop()) >= 0) && ((jQuery(window).scrollTop()) <= 70)) {
- jQuery("#header").stop().animate({
- top: 0
- }, 100);
- } else {
- jQuery("#header").stop().animate({
- top: -97
- }, 500);
- }
- });
- // Script For Facebook
- function PopupCenter(pageURL, title, w, h) {
- var left = (screen.width / 2) - (w / 2);
- var top = (screen.height / 2) - (h / 2);
- 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);
- }
- window.fbAsyncInit = function () {
- FB.init({
- appId: '173504196117106',
- // App ID
- channelUrl: '//www.staging.iamknighted.com/',
- // Channel File
- status: true,
- // check login status
- cookie: true,
- // enable cookies to allow the server to access the session
- xfbml: true // parse XFBML
- });
- // Additional initialization code here
- };
- // Load the SDK Asynchronously
- (function (d) {
- var js, id = 'facebook-jssdk',
- ref = d.getElementsByTagName('script')[0];
- if (d.getElementById(id)) {
- return;
- }
- js = d.createElement('script');
- js.id = id;
- js.async = true;
- js.src = "//connect.facebook.net/en_US/all.js";
- ref.parentNode.insertBefore(js, ref);
- }(document));
Advertisement
Add Comment
Please, Sign In to add comment