JAVASCRIPT   72
global js
Guest on 8th March 2023 12:31:16 PM


  1. (function($) {
  2.  
  3.         // Using strict mode
  4.  
  5.         "use strict";
  6.  
  7. /* PRICING TABLERS
  8.  * Create wrapper around pricing tables located in one column
  9.  */
  10. function fix_pricing_tables() {
  11.         var $cols = $('.post_content .grid').find('.col');
  12.         $cols.each(function() {
  13.                
  14.                 var $pricingTables = $(this).find('.pricing_item');
  15.                 if( $pricingTables.length > 0 ) {
  16.                         var wrapperStart = '<div class="pricing-1 grid_' + $pricingTables.length + ' clearfix">';
  17.                         var wrapperEnd = '</div>';
  18.                        
  19.                         $pricingTables.wrapAll( wrapperStart + wrapperEnd );
  20.                 }
  21.                
  22.         });
  23.        
  24.         var $faqHeaderItem = $('.faq_header_item');
  25.         if( $faqHeaderItem.length > 0 ) {
  26.                 $faqHeaderItem.each(function(){
  27.                         var chapterSectionId = $(this).attr('href');
  28.                        
  29.                         var $chapterSection = $( chapterSectionId );
  30.                        
  31.                        
  32.                         var numberOfItems = 0;
  33.                         if( $chapterSection.length > 0 ) {
  34.                                
  35.                                 numberOfItems = $chapterSection.parent().find('.faq_item').length;
  36.                         }
  37.                        
  38.                         $(this).find('.faq_header_item_count').html( numberOfItems );
  39.                 });
  40.         }
  41. }
  42.  
  43. function fix_faq_sections() {
  44. }
  45.  
  46. function init_logo_slider() {
  47.         jQuery(document).ready(function() {
  48.         $('.client_logo_slider').each(function(){
  49.        
  50.                 $(this).carouFredSel({
  51.                         width: '100%',
  52.                         align: 'left',
  53.                         items: {
  54.                                 visible: {
  55.                                         min: 1,
  56.                                         max: 8
  57.                                 },
  58.                                 width: "variable",
  59.                                 height: "variable"
  60.                         },
  61.                         scroll  : {
  62.                                 items                   : 1,
  63.                                 duration                : 1000,
  64.                                 timeoutDuration : 2000
  65.                         },
  66.                         auto    : ( '1' == $(this).attr('data-autoscroll') ),
  67.                         next: $(this).parent().find(".btn_next"),
  68.                         prev: $(this).parent().find(".btn_prev")
  69.                 }).parent().css("margin", "auto");
  70.         });
  71.         });
  72.        
  73.        
  74.         $('.photo_slider-1 ul li').css('display', 'block');
  75.  
  76.         $('.photo_slider-1').each(function(){
  77.                 var $slider = $(this);
  78.                 $(this).find('ul').bxSlider({
  79.                         pager: false
  80.                 });
  81.         });
  82.        
  83.         $('.recent_posts_slider-2_wrapper').each(function() {
  84.                 var $next = $(this).find('.btn_next');
  85.                 var $prev = $(this).find('.btn_prev');
  86.                
  87.                 $(this).find('.recent_posts_slider-2').carouFredSel({
  88.                         circular: false,
  89.                         responsive: true,
  90.                         width: '100%',
  91.                         height: "variable",
  92.                         items: {
  93.                                 width: 280,
  94.                                 visible: {
  95.                                         min: 1,
  96.                                         max: 3
  97.                                 },
  98.                                 height: "variable"
  99.                         },
  100.                         scroll: {
  101.                                 duration: 1000,
  102.                                 pauseOnHover: true
  103.                         },
  104.                         auto: 2000,
  105.                         swipe: true,
  106.                         next: $next,
  107.                         prev: $prev
  108.                 });
  109.         });
  110.        
  111.         $('.recent_posts_slider').each(function() {
  112.                
  113.                 var numberOfColumns = $(this).attr('data-num-columns');
  114.                 var imageWidth = $(this).attr('data-image-width');
  115.                 var autoslideInterval = 1*$(this).attr('data-autoslide-interval');
  116.                 var autoslideStopClick = $(this).attr('data-autoslide-stop-click');
  117.                
  118.                 var $slider= $(this);
  119.                 var $prev = $(this).parent().find(".btn_prev");
  120.                 var $next = $(this).parent().find(".btn_next");
  121.                
  122.                 if( autoslideStopClick == 'yes' ) {
  123.                         var stopFunction = (function(){
  124.                                 $slider.trigger("configuration", {
  125.                                         auto: false,
  126.                                 });
  127.                         });
  128.                        
  129.                         $next.click( stopFunction );
  130.                         $prev.click( stopFunction );
  131.                 }
  132.                 $(this).carouFredSel({
  133.                         circular: false,
  134.                         responsive: true,
  135.                         width: '100%',
  136.                         height: "variable",
  137.                         items: {
  138.                                 width: imageWidth,
  139.                                 visible: {
  140.                                         min: 1,
  141.                                         max: numberOfColumns
  142.                                 },
  143.                                 height: "variable"
  144.                         },
  145.                         scroll: {
  146.                                 duration: 1000,
  147.                                 //pauseOnHover: true,
  148.                                 pauseOnEvent: true,
  149.                                
  150.                         },
  151.                         auto: {
  152.                                 play: (autoslideInterval != 0),
  153.                                 timeoutDuration: autoslideInterval,
  154.                                 pauseOnEvent: true,
  155.                                
  156.                                
  157.                         },
  158.                         swipe: true,
  159.                         next: $next,
  160.                         prev: $prev
  161.                 });
  162.         });
  163. }
  164.  
  165. /* STICKY FOOTER */
  166.  
  167. function sticky_footer(){
  168.  
  169.         var footer_container_height = $('.footer_container').outerHeight();
  170.         $('#layout_width').css('height', '100%');
  171.         $('.content_container').css('min-height', '100%').css('margin-bottom', '-'+footer_container_height+'px');
  172.         $('.footer_push').css('height', footer_container_height+'px');
  173.  
  174. }
  175.  
  176. /* FIXED HEADER */
  177.  
  178.  
  179. function fx_h_2() {
  180.  
  181.                 // height of the info contact header
  182.                 var headerInfoHeight = $('.header-2_container').outerHeight();
  183.                 // height of the main navigation
  184.                 if( $('body').hasClass('admin-bar') ) {
  185.                         headerInfoHeight += $('#wpadminbar').outerHeight();
  186.                         //newHeight += $('#wpadminbar').outerHeight();
  187.                 }
  188.                
  189.                 var $headerMainWrapper = $('.header_main_wrapper');
  190.                 var $topContent = $('.top_content');
  191.                 var $jqres = $('.jqres');
  192.                
  193.                 var logoMarginTop = parseInt($headerMainWrapper.find('.logo').css('margin-top'));
  194.                 var logoMarginBottom = parseInt($headerMainWrapper.find('.logo').css('margin-bottom'));
  195.                 var searchMarginTop = parseInt($headerMainWrapper.find('.search_top_button').css('margin-top'));
  196.                 var topMenuItemALineHeight = parseInt($headerMainWrapper.find('.navigation-1_container').find('.top-menu-item-a').css('line-height'));
  197.                
  198.                 if( $('.header-1_container').outerHeight() > topMenuItemALineHeight ){
  199.                         topMenuItemALineHeight = $('.header-1_container').outerHeight() - 1;
  200.                         searchMarginTop = parseInt( $('.header-1_container').outerHeight() / 2 ) - ( $headerMainWrapper.find('.search_top_button').outerHeight() / 2 );
  201.                 }
  202.                
  203.                 var heightReduction = 16;
  204.                 var heightReductionHalf = heightReduction / 2;
  205.                
  206.                 var $searchTopOverlay = $('.search_top_overlay');
  207.                 var scrollIt = function( ) {
  208.                         var headerContactHeight = $('.header_main_wrapper').outerHeight();
  209.  
  210.                                 // is desktop
  211.  
  212.                                 if ( ($jqres.width() > 840) && ( $('.header_main_wrapper').attr('data-position') == 'fixed')) {
  213.                                         // current number of pixels window scrolled down
  214.                                         var currentWindowScroll = ( $(window).scrollTop() );
  215.                                         // is the header already non visible ?
  216.                                         var headerPositionAgainstWindow = headerInfoHeight - currentWindowScroll;
  217.                                        
  218.                                         // is the header already non visible ?
  219.                                         if( headerPositionAgainstWindow <= 0 ) {
  220.                                                 var headerZeroPosition = 0;
  221.                                                 if( $('body').hasClass('admin-bar') ) {
  222.                                                         headerZeroPosition = $('#wpadminbar').outerHeight();
  223.                                                         //newHeight += $('#wpadminbar').outerHeight();
  224.                                                 }
  225.                                                
  226.                                                
  227.                                                 $headerMainWrapper.css('position', 'fixed').css('top', headerZeroPosition);
  228.                                                 var newHeight = headerContactHeight;
  229.  
  230.                                        
  231.                                                 if( $searchTopOverlay.css('display') == 'block' ) {
  232.                                                         newHeight+= $searchTopOverlay.outerHeight();
  233.                                                 }
  234.                                                
  235.                                                 $topContent.css('padding-top', newHeight );
  236.                                         } else {
  237.                                                 $headerMainWrapper.css('position', 'static').css('top', headerInfoHeight);
  238.                                                 $topContent.css('padding-top', 0);
  239.                                         }
  240.                                         if( currentWindowScroll > 200 ) {
  241.                                                 $headerMainWrapper.addClass('header_compact');
  242.                                                 $headerMainWrapper.removeClass('header_noncompact');
  243.                                                 if( true ) {
  244.                                                         $headerMainWrapper.find('.logo').css('margin-top', ( logoMarginTop - heightReductionHalf) );
  245.                                                         $headerMainWrapper.find('.logo').css('margin-bottom', ( logoMarginBottom - heightReductionHalf) );
  246.                                                        
  247.                                                         $headerMainWrapper.find('.navigation-1_container').find('.top-menu-item-a').css('line-height', (topMenuItemALineHeight - heightReduction)+'px' );
  248.                                                        
  249.                                                         $headerMainWrapper.find('.search_top_button').css('margin-top', (searchMarginTop - heightReductionHalf ) );
  250.                                                 }
  251.                                                
  252.                                                  
  253.                                                
  254.                                         } else {
  255.                                                 $headerMainWrapper.removeClass('header_compact');
  256.                                                 $headerMainWrapper.addClass('header_noncompact');
  257.                                                 if( true ) {
  258.                                                         $headerMainWrapper.find('.logo').css('margin-top', logoMarginTop  );
  259.                                                         $headerMainWrapper.find('.logo').css('margin-bottom', logoMarginBottom );
  260.                                                        
  261.                                                         $headerMainWrapper.find('.navigation-1_container').find('.top-menu-item-a').css('line-height', (topMenuItemALineHeight)+'px' );
  262.                                                        
  263.                                                         $headerMainWrapper.find('.search_top_button').css('margin-top', (searchMarginTop) );
  264.                                                 }
  265.                                         }
  266.                                        
  267.                                 // is mobile device
  268.                                 } else {
  269.                                         $headerMainWrapper.css('position', 'static');
  270.                                         $topContent.css('padding-top', '0');
  271.                                        
  272.                                 }
  273.                 }
  274.                 $(window).bind('changeMenuStyle', function() { scrollIt(); setTimeout( scrollIt, 150 ); });
  275.                 $(window).scroll(function(){ scrollIt(); });
  276.                 $(document).ready(function() {
  277.                         setTimeout( scrollIt, 300);
  278.                 });
  279. }
  280. fx_h_2();
  281. function fixed_header(){
  282. }
  283.  
  284. /* CENTER NAVIGATION-1 */
  285.  
  286. function center_navigation_1() {
  287.  
  288.         var headerHeight = $('.header-1_container').outerHeight();
  289.         var searchbuttonHeight = $('.search_top_button').height();
  290.         var borderHeight = headerHeight - $('.header-1_container').height();
  291.  
  292.         // search button centering
  293.  
  294.         $('.navigation-1 .search_top_button').css('margin-top', (headerHeight - borderHeight - searchbuttonHeight) / 2);
  295.  
  296.         // (line)height of the navigation links - should be the same as the header height minus borders
  297.  
  298.         $('.navigation-1 .top-menu-item-a').css('line-height', headerHeight - borderHeight + 1 + 'px' );
  299.         fixed_header();
  300. }
  301.  
  302. /* NAVIGATION-1 - SUB-MENU - OPENING/CLOSING ANIMATION */
  303.  
  304. function navigation_1_sub_menu()        {
  305.         var animation_time = 250;
  306.         $('.navigation-1').removeClass("fallback");
  307.         $('.navigation-1 li').hover(
  308.                        
  309.                 function(){
  310.                         var subMenu = $(this).children('.sub-menu');
  311.                        
  312.                         if( subMenu.css('display') == 'none' ) {
  313.                                 subMenu.css('opacity','0');
  314.                                 subMenu.css('display','block');
  315.                         }
  316.                 subMenu.stop(true, false).animate({opacity:1},animation_time);
  317.                 }, function() {
  318.                        
  319.                         var subMenu = $(this).children('.sub-menu');
  320.                         subMenu.stop(true,false).animate( {opacity:0},animation_time, function(){ $(this).css('display','none'); }  );
  321.                 }
  322.         );
  323. }
  324.  
  325. /* SEARCH TOP - OPEN/CLOSE OVERLAY */
  326.  
  327. function search_top_overlay_toggle() {
  328.  
  329.         $('.search_top_button').click(function () {
  330.            $('.search_top_overlay').stop().slideToggle(200);
  331.            $('.search_top_overlay input:text').focus();
  332.         });
  333.  
  334.         $('.search_top_close').click(function () {
  335.            $('.search_top_overlay').stop().slideToggle(200);
  336.            $('.search_top_overlay input:text').focus();
  337.         });
  338.  
  339.         $('.search_top_overlay .searchfield').keyup(function(e){
  340.                 if(e.keyCode === 27){
  341.                         $('.search_top_overlay').stop().slideUp(200);
  342.                 }
  343.         });
  344.  
  345. }
  346.  
  347. /* CENTER NAVIGATION-2 */
  348.  
  349. function center_navigation_2() {
  350.  
  351.         var nav2 = $('.navigation-2');
  352.         var header = $('.header-1_container');
  353.        
  354.        
  355.         var headerHeight = header.outerHeight();
  356.         var nav2Height = nav2.outerHeight();
  357.        
  358.         var difference = Math.ceil(( headerHeight - nav2Height ) / 2 - 3);
  359.         nav2.css('top', difference);
  360.  
  361. }
  362.  
  363. /* NAVIGATION-2 - NAVIGATION-MOBILE - TOGGLE OPENING AND CLOSING */
  364.  
  365. function toggle_mobile_menu() {
  366.         $('.mobile_nav_button').click(function(){
  367.                 $('.navigation-2').toggleClass("navigation-2_active");
  368.             $('.navigation-mobile').slideToggle();
  369.         });
  370. }
  371.  
  372. /* NAVIGATION-2 - NAVIGATION-MOBILE - POSITION */
  373.  
  374. function navigation_mobile_position()   {
  375.  
  376.         var header = $('.header-1_container');
  377.         var mobilebtn = $('.mobile_nav_button');
  378.         var headerHeight = header.outerHeight();
  379.         var mobilebtnHeight = mobilebtn.outerHeight();
  380.         var pos = Math.ceil(headerHeight - mobilebtnHeight / 2) - 3;
  381.  
  382.         $('.navigation-mobile').css('top', pos);
  383.  
  384. }
  385.  
  386. /* NAVIGATION-2 - SUB-MENU OPEN/CLOSE TOGGLE */
  387.  
  388. function navigation_2_sub_menu_toggle()         {
  389.  
  390.         $('.navigation-2 li').hover(
  391.                 function(){
  392.                 $(this).parents(".sub-menu").css("height", "auto");
  393.                 $(this).children(".sub-menu").stop(false,true).slideDown();
  394.                 },
  395.                 function(){
  396.                 $(this).children(".sub-menu").stop(false,false).slideUp();
  397.                 }
  398.         );
  399.  
  400. }
  401.  
  402. /* FOOTER-SOCIAL - SOCIAL TICKER TOTEM PLUGIN */
  403.  
  404. var social_ticker_el = null;
  405.  
  406. function social_ticker()        {
  407.  
  408.         if ( social_ticker_el ) {
  409.                 if( social_ticker_el.destroySlider ) {
  410.                         social_ticker_el.destroySlider();
  411.                 }
  412.         }
  413.  
  414.         social_ticker_el = $('.footer-social .timeline').bxSlider({
  415.                 controls: false,
  416.                 pager: false,
  417.                 mode: 'vertical',
  418.                 auto: true,
  419.                 pause: 5000,
  420.                 responsive: false,
  421.                 //minSlides: 1,
  422.                 //maxSlides: 1,
  423.                 touchEnabled: false,
  424.                 autoHover: true,
  425.                 slideMargin: 10,
  426.                 //mode: 'vertical',
  427.                 //auto: true,
  428.                 //speed: 300,
  429.                 //adaptiveHeight: true,
  430.         });
  431.  
  432.         $('.footer-social .timeline').css('visibility','visible');
  433. }
  434.  
  435. $(document).ready(function($){
  436.  
  437.         /* PORTFOLIO SORTABLE */
  438.        
  439.         var $container = $('.portfolio-cat-1 .portfolio_grid');
  440.         var $gridcols = $('.portfolio-cat-1 .portfolio_grid').attr('data-portfolio-cols');
  441.         var $checkboxes = $('.portfolio_sortable a');
  442.  
  443.         $('.portfolio-cat-1 .portfolio_grid').css('opacity','0');
  444.  
  445.         // initialize Isotope
  446.         $container.imagesLoaded( function(){
  447.                 $('.portfolio-cat-1 .portfolio_grid_wrapper').css('background','none');
  448.                 $('.portfolio-cat-1 .portfolio_grid').stop().animate({opacity:1},500);
  449.  
  450.                 $container.isotope({
  451.                   // options...
  452.                   resizable: false, // disable normal resizing
  453.                   layoutMode : 'fitRows',
  454.               itemSelector: '.portfolio-post-1_container',
  455.                   // set columnWidth to a percentage of container width
  456.                   masonry: { columnWidth: $container.width() / $gridcols }
  457.                 });
  458.         });
  459.  
  460.         // update columnWidth on window resize
  461.         $(window).smartresize(function(){
  462.           $container.isotope({
  463.             // update columnWidth to a percentage of container width
  464.             masonry: { columnWidth: $container.width() / $gridcols }
  465.           });
  466.         });
  467.  
  468.         // sortable filters
  469.         $('.portfolio_sortable a').click(function(){
  470.           var selector = $(this).attr('data-filter');
  471.           $container.isotope({ filter: selector });
  472.           return false;
  473.         });
  474.  
  475.         // number of visible objects
  476.     var $items = $('.portfolio-post-1_container'); // to reference methods on all .item divs later
  477.  
  478.     $checkboxes.click(function() {
  479.         var filters = [];
  480.         // get checked checkboxes values
  481.        
  482.         filters.push($(this).attr('data-filter'));
  483.        
  484.         // ['.red', '.blue'] -> '.red, .blue'
  485.         filters = filters.join(', ');
  486.         $container.isotope({
  487.             filter: filters
  488.         }, function($changedItems, instance) {
  489.             instance.$allAtoms.filter('.isotope-hidden').removeClass('is-filtered');
  490.             instance.$filteredAtoms.addClass('is-filtered');
  491.             $('.portfolio_sortable_count_number').html(instance.$filteredAtoms.size());
  492.         });
  493.        
  494.     });
  495.  
  496.     $('.portfolio_sortable a.all').click();
  497.  
  498.         /* STICKY FOOTER */
  499.  
  500.         sticky_footer()
  501.  
  502.         $(window).resize(function() {
  503.                 sticky_footer()
  504.         });
  505.  
  506.         /* CENTER NAVIGATION-1 */
  507.  
  508.         $('.logo').find('img').load(function(){
  509.                 center_navigation_1();
  510.         });
  511.  
  512.         center_navigation_1();
  513.  
  514.         $(window).resize(function() {
  515.                 center_navigation_1();
  516.         });
  517.  
  518.         /* NAVIGATION-1 - SUB-MENU - OPENING/CLOSING ANIMATION */
  519.  
  520.         navigation_1_sub_menu();
  521.  
  522.         /* SEARCH TOP - OPEN/CLOSE OVERLAY */
  523.  
  524.         search_top_overlay_toggle();
  525.  
  526.         /* CENTER NAVIGATION-2 */
  527.  
  528.         $('.logo').find('img').load(function(){
  529.                 center_navigation_2();
  530.         });
  531.  
  532.         center_navigation_2();
  533.  
  534.         $(window).resize(function() {
  535.                 center_navigation_2();
  536.         });
  537.  
  538.         /* NAVIGATION-2 - NAVIGATION-MOBILE - TOGGLE OPENING AND CLOSING */
  539.  
  540.         toggle_mobile_menu();
  541.  
  542.         /* NAVIGATION-2 - NAVIGATION-MOBILE - POSITION */
  543.  
  544.         navigation_mobile_position();
  545.  
  546.         $(window).resize(function() {
  547.                 navigation_mobile_position();
  548.         });
  549.  
  550.         /* NAVIGATION-2 - SUB-MENU OPEN/CLOSE TOGGLE */
  551.  
  552.         navigation_2_sub_menu_toggle();
  553.  
  554.         /* FIXED HEADER */
  555.  
  556.         fixed_header();
  557.  
  558.         $(window).resize(function() {
  559.                 fixed_header();
  560.         });
  561.  
  562.         /* BACK TO TOP */
  563.  
  564.         $('.back_to_top').click(function() {
  565.                 $('body,html').animate({scrollTop:0}, 300);
  566.                 return false;
  567.         });
  568.  
  569.         /* FEATURED IMAGE HOVER - DEFAULT */
  570.  
  571.        
  572.         $('a.featured_image_wrapper').hover(function() {
  573.                 $(this).find('.featured_image').stop().animate({opacity:0.25},200);
  574.         }, function() {
  575.                 $(this).find('.featured_image').stop().animate({opacity:1},200);
  576.         });
  577.  
  578.        
  579.  
  580.         /* MAGNIFIC POPUP INIT - FEATURED IMAGE */
  581.  
  582.         $('.featured_image_wrapper, .rps_image_zoom, .portfolio_image_zoom').each(function(){
  583.                 if ($(this).parents('.product_slider').size() == 0){
  584.                         $(this).magnificPopup({
  585.                           type: 'image',
  586.                           image:{
  587.                                         cursor: null
  588.                           },
  589.                           removalDelay: 200, //delay removal by X to allow out-animation
  590.                           callbacks: {
  591.                             beforeOpen: function() {
  592.                               // just a hack that adds mfp-anim class to markup
  593.                                this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
  594.                                this.st.mainClass = this.st.el.attr('data-effect');
  595.                             },
  596.                             open: function()    {
  597.                             },
  598.                             close: function()   {
  599.                             }
  600.                           },
  601.                           closeOnContentClick: true,
  602.                           midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
  603.                         });
  604.                 }
  605.         });
  606.  
  607.         /* SHORTCODE - ACCORDEON */
  608.  
  609.         $('.tb_accordeon_item_post_title_wrapper').click(function() {
  610.                 if( $(this).parents('.tb_accordeon_wrapper').find(':animated').size() != 0 )
  611.                         return false;
  612.                 var one_item = $(this).parent();
  613.                 var text_wrapper = one_item.find('.tb_accordeon_item_content_wrapper');
  614.                 var text_content = text_wrapper.find('.tb_accordeon_item_content');
  615.                 var title_bg = one_item.find('.tb_accordeon_item_title_bg');
  616.  
  617.                 if( text_wrapper.height() == 0 ) {
  618.                         one_item.addClass('tb_accordeon_item_active');
  619.                         text_wrapper.css('display','block').animate({height: text_content[0].scrollHeight - 16 }, 500);
  620.                         title_bg.fadeOut(500);
  621.                 } else {
  622.                         text_wrapper.animate({height:0}, 500, function() { $(this).css('display','none'); } );
  623.                         one_item.removeClass('tb_accordeon_item_active');
  624.                         title_bg.fadeIn(500);
  625.                 }
  626.  
  627.                 var accordeon_holder = $(this).parent().parent();
  628.                 accordeon_holder.find('.tb_accordeon_item').each(function() {
  629.                         if( $(this).find(':animated').size() == 0 ) {
  630.                                 $(this).find('.tb_accordeon_item_content_wrapper').animate({height:0}, 500);
  631.                                 $(this).removeClass('tb_accordeon_item_active');
  632.                                 $(this).find('.tb_accordeon_item_title_bg').fadeIn(500);
  633.                         }
  634.                 });
  635.         });
  636.        
  637.         $(window).resize(function() {
  638.                 $('.tb_accordeon_item_active').each(function(){
  639.                         var text_wrapper = $(this).find('.tb_accordeon_item_content_wrapper');
  640.                         var text_content = $(this).find('.tb_accordeon_item_content');
  641.  
  642.                         if( text_wrapper.height() != 0 ) {
  643.                                 text_wrapper.css('height', text_content[0].scrollHeight - 16 );
  644.                         }
  645.                 });
  646.         });
  647.  
  648.         /* SHORTCODE - TABS */
  649.  
  650.         $('.tb_tabs_title').click(function() {
  651.                 if( $(this).hasClass('tb_tabs_title_active') )
  652.                         return false;
  653.  
  654.                 var tabs = $(this).parent().parent();
  655.  
  656.                 tabs.find('.tb_tabs_title').removeClass('tb_tabs_title_active');
  657.                 $(this).addClass('tb_tabs_title_active');
  658.                 var item_position = $(this).index();
  659.                 tabs.find('.tb_tabs_item_content').css('display','none');
  660.  
  661.                 tabs.find('.tb_tabs_item_content').eq( item_position ).css({'display':'block', 'opacity':0.2}).animate({opacity:1}, 200);
  662.  
  663.         });
  664.  
  665.         /* SCROLL TO WITH INTERNAL ANCHOR LINKS */
  666.  
  667.         function getElemementToScroll(){
  668.                 if( -1 == document.URL.indexOf('#') ){
  669.                         return null;
  670.                 }
  671.  
  672.                 var _id;
  673.                 _id = document.URL.split('#');
  674.                 _id = "" + _id[1];
  675.                 if( _id.length < 1 ) {
  676.                         return null;
  677.                 }
  678.  
  679.                 if( $( '#' + _id ).size() < 1 ){
  680.                         return null;
  681.                 }
  682.  
  683.                 if( ! $( '#' + _id ).hasClass('scrollto') ){
  684.                         return null;
  685.                 }
  686.  
  687.                 return _id;
  688.         }
  689.  
  690.         function scrollToElement(){
  691.                 var _id = getElemementToScroll();
  692.                 if( _id ) { } else{
  693.                         return;
  694.                 }
  695.  
  696.                 // Scroll - ID
  697.                 var _scroll_pos = 0;
  698.                 _scroll_pos += $( '#' + _id ).offset().top;
  699.  
  700.                 // Scroll - header repair
  701.                 var fixed_header_height = 0;
  702.                 if ( $(".jqres").width() > 840) { // responsive
  703.                         fixed_header_height = $('.header_main_wrapper').outerHeight();
  704.                 }
  705.                 _scroll_pos -= fixed_header_height;
  706.  
  707.                 // admin bar
  708.                 if( $('body').hasClass('admin-bar') ) {
  709.                         _scroll_pos -= $('#wpadminbar').outerHeight();
  710.                 }
  711.  
  712.                 // Bulgarian const = Correction
  713.                 _scroll_pos -= 30;
  714.  
  715.                 $('html, body').stop().animate({
  716.                         'scrollTop': _scroll_pos
  717.                 }, 100, 'swing', function () {
  718.                         //window.location.hash = target;
  719.                 });
  720.  
  721.  
  722.         }
  723.  
  724.         /*
  725.         $(document).ready(function(){
  726.                 $('a[href^="#"]').on('click',function (e) {
  727.                     e.preventDefault();
  728.  
  729.                     var target = this.hash,
  730.                     $target = $(target);
  731.  
  732.                     if ( $(".jqres").width() > 840) { // responsive
  733.                                 var fixed_header_height = $('.header-1_container').outerHeight();
  734.                         }
  735.  
  736.                     $('html, body').stop().animate({
  737.                         'scrollTop': $target.offset().top - fixed_header_height - 60
  738.                     }, 900, 'swing', function () {
  739.                         //window.location.hash = target;
  740.                     });
  741.                     return false;
  742.                 });
  743.         });
  744.  
  745.         */
  746.  
  747.         /* FOOTER-SOCIAL - SOCIAL TICKER */
  748.  
  749.         setTimeout(function(){
  750.                 social_ticker()
  751.                 $('.footer-social_container').css('max-height', 'none');
  752.         },10)
  753.  
  754.         var firsttweetheight = $('.footer-social .timeline li:first').height();
  755.         $('.footer-social_container').css('max-height', firsttweetheight);
  756.  
  757. });
  758.  
  759.  
  760. $(window).load(function () {
  761.  
  762.         /* FIXED HEADER */
  763.  
  764.         fixed_header();
  765.  
  766.         /* CENTER NAVIGATION-1 */
  767.  
  768.         center_navigation_1();
  769.  
  770.         /* SEARCH TOP - POSITION */
  771.  
  772.         /*search_top_overlay_position()*/
  773.  
  774.         /* CENTER NAVIGATION-2 */
  775.  
  776.         center_navigation_2();
  777.  
  778.         /* NAVIGATION-2 - NAVIGATION-MOBILE - POSITION */
  779.  
  780.         navigation_mobile_position();
  781.  
  782.         init_logo_slider();
  783.  
  784.         /* SHORTCODE - ACCORDEON - OPEN ON PAGELOAD */
  785.  
  786.         $('.tb_accordeon_item_open .tb_accordeon_item_post_title_wrapper').click();
  787.  
  788.         /* FOOTER-SOCIAL - SOCIAL TICKER */
  789.  
  790.         $(window).resize(function() {
  791.                 social_ticker()
  792.         });
  793.  
  794.         /* INITIALIZE BXSLIDER */
  795.  
  796.         setTimeout(function(){
  797.                 $('.bxslider').bxSlider({
  798.                         pager: false,
  799.                 })
  800.         }, 10 );
  801.  
  802.         /* STICKY FOOTER */
  803.  
  804.         setTimeout(function(){
  805.                 sticky_footer()
  806.         },11)
  807. });
  808.  
  809. })(jQuery);

Raw Paste

Login or Register to edit or fork this paste. It's free.