1jQuery(document).ready(function ($) { 2 "use strict"; 3 4 var masonaryGrid = null; 5 6 /*tab ajax*/ 7 $('.barta-tab-cat ul li').on('click', 'span', function () { 8 9 var _this = $(this), 10 container = _this.parents('.rtin-tab-container'), 11 dataWrapper = _this.parents('.barta-tab-cat'), 12 catID = _this.attr("data-tab-cat"), 13 wtgetData = dataWrapper.data("settings"), 14 template = dataWrapper.data("template"), 15 contentWrap = container.find('.rt-tab-news-holder'), 16 contentWrapHeight = contentWrap.outerHeight(), 17 ul = _this.parents('ul'); 18 ul.find('li').removeClass('active'); 19 _this.parent().addClass('active'); 20 21 $.ajax({ 22 url: ThemeObj.ajaxURL, 23 data: {catID: catID, action: 'barta_selected_cat', data: wtgetData, template: template}, 24 type: 'POST', 25 beforeSend: function () { 26 contentWrap.find('.loading').fadeIn('slow'); 27 }, 28 success: function (resp) { 29 contentWrap.animate({ 30 opacity: 0 31 }, 1000, function () { 32 if (resp.remaining) { 33 ul.find('.more-link').show(); 34 ul.find('.more-link a').attr('href', resp.cat_link); 35 } else { 36 ul.find('.more-link').hide(); 37 ul.find('.more-link a').attr('href', ""); 38 } 39 40 contentWrap.find('.loading').fadeOut('slow'); 41 contentWrap.html(resp.html); 42 contentWrap.css({opacity: 1}); 43 }); 44 }, 45 error: function (e) { 46 console.log(e); 47 } 48 }); 49 50 }); 51 52 53 var a = $('.offscreen-navigation .menu'); 54 if (a.length) { 55 $(".menu-item-has-children").append("<span></span>"); 56 $(".page_item_has_children").append("<span></span>"); 57 58 a.children("li").addClass("menu-item-parent"); 59 60 $('.menu-item-has-children > span').on('click', function () { 61 $(this).siblings('a').first().toggleClass('opened'); 62 var _self = $(this), 63 sub_menu = _self.parent().find('>.sub-menu'); 64 if (_self.hasClass('open')) { 65 sub_menu.slideUp(); 66 _self.removeClass('open'); 67 } else { 68 sub_menu.slideDown(); 69 _self.addClass('open'); 70 } 71 }); 72 $('.page_item_has_children > span').on('click', function () { 73 var _self = $(this), 74 sub_menu = _self.parent().find('>.children'); 75 if (_self.hasClass('open')) { 76 sub_menu.slideUp(); 77 _self.removeClass('open'); 78 } else { 79 sub_menu.slideDown(); 80 _self.addClass('open'); 81 } 82 }); 83 84 $('.offscreen-navigation .menu-item-parent > a, .offscreen-navigation .menu-item-has-children a').on('click', function () { 85 setTimeout(function() { 86 $('.mean-bar .sidebarBtn').trigger('click'); 87 }, 300) 88 }); 89 } 90 91 $('.mean-bar .sidebarBtn').on('click', function (e) { 92 e.preventDefault(); 93 if ($('.rt-slide-nav').is(":visible")) { 94 $('.rt-slide-nav').slideUp(); 95 $('body').removeClass('slidemenuon'); 96 } else { 97 $('.rt-slide-nav').slideDown(); 98 $('body').addClass('slidemenuon'); 99 } 100 }); 101 102 $('.br-filter-form').on('submit', function(e){ 103 e.preventDefault(); 104 105 var catIDs = []; 106 $.each($("input[name='post_cat']:checked"), function(){ 107 catIDs.push($(this).val()); 108 }); 109 110 var contentWrap = $('.site-content-wrap'); 111 var counter = $('body div.count-post span'); 112 113 $.ajax({
114 url: ThemeObj.ajaxURL, 115 data: { catIDs: catIDs, action:'br_cat_selected_cat' }, 116 117 type: 'POST', 118 beforeSend: function () { 119 contentWrap.find('.loading').fadeIn('slow'); 120 }, 121 success: function (resp) { 122 contentWrap.animate({ 123 opacity: 0 124 }, 1000, function () { 125 contentWrap.find('.loading').fadeOut('slow'); 126 contentWrap.html(resp.html); 127 128 129 contentWrap.css({opacity: 1}); 130 }); 131 counter.html(resp.dd); 132 console.log(resp.dd); 133 }, 134 error: function (e) { 135 console.log(e); 136 } 137 }); 138 139 }); 140 141 $('.filter-wrapper').on( 'click', '.filter-title span', function(){ 142 $('.search-items input.boxes').prop("checked", false); 143 }); 144 145 /*Load More JS*/ 146 var loadMoreData = { 147 canBeLoaded: true, 148 bottomOffset: 200, 149 hasMorePost: true, 150 paged: 1, 151 }; 152 153 $('.barta_loadmore').click(function () { 154 var data = { 155 action: 'barta_loadmore', 156 paged: loadMoreData.paged, 157 layout_2: $('.blog-layout-2').data("layout"), 158 layout_3: $('.blog-layout-3').data("layout"), 159 layout_4: $('.blog-layout-4-masonry').data("layout"), 160 layout_5: $('.blog-layout-5-masonry').data("layout"), 161 162 /*termId: $('.blog-layout').parents('.blog-layouts').data('termid') || 0, 163 taxonomy: $('.blog-layout').parents('.blog-layouts').data('taxonomy') || null,*/ 164 165 termId: $('.blog-layouts').data('termid') || 0, 166 taxonomy: $('.blog-layouts').data('taxonomy') || null, 167 168 } 169 console.log(data); 170 171 if (loadMoreData.canBeLoaded) { 172 173 $.ajax({
174 url: ThemeObj.ajaxURL, 175 data: data, 176 type: 'POST', 177 beforeSend: function (xhr) { 178 loadMoreData.canBeLoaded = false; 179 $('.barta_loadmore').text('Loading...'); 180 }, 181 success: function (data) { 182 console.log(data); 183 loadMoreData.paged = data.paged; 184 185 if (data.html) { 186 if (masonaryGrid) { 187 masonaryGrid.append(data.html) 188 .masonry('appended', data.html) 189 .masonry('reloadItems') 190 .masonry(); 191 setTimeout(function () { 192 masonaryGrid.masonry(); 193 }, 300); 194 } else { 195 $(".barta-loadmore").append(data.html); 196 } 197 } 198 199 if (data.more) { 200 $('.barta_loadmore').text('More posts...'); 201 loadMoreData.canBeLoaded = true; 202 loadMoreData.hasMorePost = false; 203 } // TODO Nedd to do for else condition 204 } 205 }); 206 } 207 }); 208 209 /*Infinity Scroll JS*/ 210 var infinityData = { 211 canBeLoaded: true, 212 bottomOffset: 200, 213 hasMorePost: true, 214 paged: 1, 215 scrollWrapper: $('.barta-infinity-scroll') || false 216 }; 217 218 if (infinityData.scrollWrapper.length) { 219 $(document).on('scroll load', function () { 220 var data = { 221 'action': 'barta_infinity_loadmore', 222 'paged': infinityData.paged, 223 'layout_2': $('.blog-layout-2').data("layout"), 224 'layout_3': $('.blog-layout-3').data("layout"), 225 'layout_4': $('.blog-layout-4-masonry').data("layout"), 226 'layout_5': $('.blog-layout-5-masonry').data("layout"), 227 'is_masonry': $('.blog-layout-2.blog-layout-4-masonry').length, 228 229 termId: $('.blog-layouts').data('termid') || 0, 230 taxonomy: $('.blog-layouts').data('taxonomy') || null, 231 232 }, 233 scrollPoint = $(document).scrollTop(), 234 devHeight = infinityData.scrollWrapper.offset().top + infinityData.scrollWrapper.outerHeight() - 650; 235 236 if (scrollPoint >= devHeight) { 237 238 console.log('Scroll trigger'); 239 240 if (infinityData.canBeLoaded) { 241 console.log(data); 242 $.ajax({
243 url: ThemeObj.ajaxURL, 244 data: data, 245 type: 'POST', 246 beforeSend: function (xhr) { 247 infinityData.canBeLoaded = false; 248 }, 249 success: function (data) { 250 infinityData.paged = data.paged; 251 if (data.html) { 252 if (masonaryGrid) { 253 masonaryGrid.append(data.html) 254 .masonry('appended', data.html) 255 .masonry('reloadItems') 256 .masonry(); 257 } else { 258 $(".barta-infinity-scroll").append(data.html); 259 } 260 } 261 if (data.more) { 262 infinityData.canBeLoaded = true; 263 infinityData.hasMorePost = false; 264 } // TODO Need to do for else condition 265 } 266 }); 267 } 268 } 269 }); 270 } 271 272 /* Scroll to top */ 273 $('.scrollToTop').on('click', function () { 274 $('html, body').animate({scrollTop: 0}, 800); 275 return false; 276 }); 277 278 /* Fixing for hover effect at IOS */ 279 $('*').on('touchstart', function () { 280 $(this).trigger('hover'); 281 }).on('touchend', function () { 282 $(this).trigger('hover'); 283 }); 284 285 $(window).scroll(function () { 286 if ($(this).scrollTop() > 100) { 287 $('.scrollToTop').fadeIn(); 288 $("body").addClass("not-top"); 289 $("body").removeClass("top"); 290 } else { 291 $('.scrollToTop').fadeOut(); 292 $("body").addClass("top"); 293 $("body").removeClass("not-top"); 294 } 295 }); 296 297 /* Search Box */ 298 $(".search-box-area").on('click', '.search-button, .search-close', function (event) { 299 event.preventDefault(); 300 if ($('.search-text').hasClass('active')) { 301 $('.search-text, .search-close').removeClass('active'); 302 } else { 303 $('.search-text, .search-close').addClass('active'); 304 } 305 return false; 306 }); 307 308 309 /* Header Right Menu */ 310 var menuArea = $('.additional-menu-area'); 311 menuArea.on('click', '.side-menu-trigger', function (e) { 312 e.preventDefault(); 313 //$('.sidenav').width(380); 314 $('.sidenav').css('transform', 'translateX(0%)'); 315 if (!menuArea.find('> .rt-cover').length) { 316 menuArea.append("<div class='rt-cover'></div>"); 317 } 318 }); 319 menuArea.on('click', '.closebtn', function (e) { 320 e.preventDefault(); 321 if (menuArea.find('> .rt-cover').length) { 322 menuArea.find('> .rt-cover').remove(); 323 } 324 $('.sidenav').css('transform', 'translateX(100%)'); 325 }); 326 327 $(document).on('click', '.rt-cover', function () { 328 $(this).remove(); 329 $('.sidenav').css('transform', 'translateX(100%)'); 330 }); 331 332 $(document).on('click', '.print-share-button', function (e) { 333 console.log(); 334 e.preventDefault(); 335 window.print(); 336 return false; 337 }); 338 339 340 /* Mega Menu */ 341 $('.site-header .main-navigation ul > li.mega-menu').each(function () { 342 // total num of columns 343 var items = $(this).find(' > ul.sub-menu > li').length; 344 // screen width 345 var bodyWidth = $('body').outerWidth(); 346 // main menu link width 347 var parentLinkWidth = $(this).find(' > a').outerWidth(); 348 // main menu position from left 349 var parentLinkpos = $(this).find(' > a').offset().left; 350 351 var width = items * 220; 352 var left = (width / 2) - (parentLinkWidth / 2); 353 354 var linkleftWidth = parentLinkpos + (parentLinkWidth / 2); 355 var linkRightWidth = bodyWidth - (parentLinkpos + parentLinkWidth); 356 357 // exceeds left screen 358 if ((width / 2) > linkleftWidth) { 359 $(this).find(' > ul.sub-menu').css({ 360 width: width + 'px', 361 right: 'inherit', 362 left: '-' + parentLinkpos + 'px' 363 }); 364 } 365 // exceeds right screen 366 else if ((width / 2) > linkRightWidth) { 367 $(this).find(' > ul.sub-menu').css({ 368 width: width + 'px', 369 left: 'inherit', 370 right: '-' + linkRightWidth + 'px' 371 }); 372 } else { 373 $(this).find(' > ul.sub-menu').css({ 374 width: width + 'px', 375 left: '-' + left + 'px' 376 }); 377 } 378 });
379 380 /* Sticky Menu */ 381 if (ThemeObj.stickyMenu == 1 || ThemeObj.stickyMenu == 'on') { 382 383 $(window).on('scroll', function () { 384 385 var s = $('#sticker'), 386 w = $('body'), 387 h = s.outerHeight(), 388 windowpos = $(window).scrollTop(), 389 windowWidth = $(window).width(), 390 h1 = s.parent('#header-1'), 391 h2 = s.parent('#header-2'), 392 h3 = s.parent('#header-3'), 393 h4 = s.parent('#header-4'), 394 h5 = s.parent('#header-5'), 395 h6 = s.parent('#header-6'), 396 h1he = parseInt(s.parent('#header-1').outerHeight()) + 300, 397 h2he = parseInt(s.parent('#header-2').outerHeight()) + 200, 398 h3he = parseInt(s.parent('#header-3').outerHeight()) + 200, 399 h4he = parseInt(s.parent('#header-4').outerHeight()) + 200, 400 h5he = parseInt(s.parent('#header-5').outerHeight()) + 200, 401 h6he = parseInt(s.parent('#header-6').outerHeight()) + 200, 402 h1H = h1.find('.header-top-bar').outerHeight(), 403 topBar = s.prev('.header-top-bar'), 404 topBarP = w.hasClass('has-topbar'), 405 topAdP = $('body .ad-header-top'), 406 tempMenu; 407 if (windowWidth > 991) { 408 409 w.css('padding-top', ''); 410 var topBarH, topAdH, totalheight, mBottom, headerFixed = 0; 411 topAdH = topAdP.outerHeight(); 412 /*header 1 */ 413 if (h1.length || h2.length || h3.length || h4.length || h5.length || h6.length) { 414 415 // only top bar 416 if ((topBarP == true) && (topAdH == null)) { 417 topBarH = topBar.outerHeight() + 210; 418 headerFixed = $('.masthead-container').outerHeight() + 210; 419 if (windowpos >= headerFixed) { 420 if (h1.length || h2.length || h3.length || h4.length || h5.length || h6.length) { 421 s.addClass('stickp'); 422 w.removeClass("stickh"); 423 w.addClass("non-stickh"); 424 } 425 } else { 426 s.removeClass('stickp'); 427 w.removeClass("non-stickh"); 428 w.addClass("stickh"); 429 } 430 431 } else { 432 // no topbar now 433 if (windowpos < parseInt(h1he)) { 434 s.addClass('stickp'); 435 w.removeClass("non-stickh"); 436 w.addClass("stickh"); 437 } else if (windowpos < parseInt(h2he)) { 438 s.addClass('stickp'); 439 w.removeClass("non-stickh"); 440 w.addClass("stickh"); 441 } else if (windowpos < parseInt(h3he)) { 442 s.addClass('stickp'); 443 w.removeClass("non-stickh"); 444 w.addClass("stickh"); 445 } else if (windowpos < parseInt(h4he)) { 446 s.addClass('stickp'); 447 w.removeClass("non-stickh"); 448 w.addClass("stickh"); 449 } else if (windowpos < parseInt(h5he)) { 450 s.addClass('stickp'); 451 w.removeClass("non-stickh"); 452 w.addClass("stickh"); 453 } else if (windowpos < parseInt(h6he)) { 454 s.addClass('stickp'); 455 w.removeClass("non-stickh"); 456 w.addClass("stickh"); 457 } else { 458 s.removeClass('stickp'); 459 w.removeClass("stickh"); 460 w.addClass("non-stickh"); 461 } 462 463 var masthead = $('#masthead'); 464 if (masthead.hasClass('header-fixed')) { 465 h1.css('top', '-' + topBarH + 'px'); 466 h2.css('top', '-' + topBarH + 'px'); 467 h3.css('top', '-' + topBarH + 'px'); 468 h4.css('top', '-' + topBarH + 'px'); 469 h5.css('top', '-' + topBarH + 'px'); 470 h6.css('top', '-' + topBarH + 'px'); 471 } 472 } 473 474 // ad and top bar 475 if ((topBarP == true) && (topAdH != null)) { 476 headerFixed = topBar.outerHeight(); 477 478 totalheight = headerFixed + topAdH; 479 480 if (windowpos <= topAdH || windowpos <= headerFixed) { 481 if (h1.hasClass('header-fixed') || h2.hasClass('header-fixed') || h3.hasClass('header-fixed') || h4.hasClass('header-fixed') || h5.hasClass('header-fixed') || h6.hasClass('header-fixed')) { 482 h1.css('top', '-' + windowpos + 'px'); 483 h2.css('top', '-' + windowpos + 'px'); 484 h3.css('top', '-' + windowpos + 'px'); 485 h4.css('top', '-' + windowpos + 'px'); 486 h5.css('top', '-' + windowpos + 'px'); 487 h6.css('top', '-' + windowpos + 'px'); 488 } 489 } 490 491 if (windowpos >= topAdH || windowpos >= headerFixed) { 492 if (h1.length || h2.length || h3.length || h4.length || h5.length || h6.length) { 493 s.addClass('stickp'); 494 w.removeClass("stickh"); 495 w.addClass("non-stickh"); 496 } 497 if (h1.length || h2.length || h3.length || h4.length || h5.length || h6.length) { 498 if (h1.hasClass('header-fixed') || h2.hasClass('header-fixed') || h3.hasClass('header-fixed') || h4.hasClass('header-fixed') || h5.hasClass('header-fixed') || h6.hasClass('header-fixed')) { 499 h1.css('top', '-' + parseInt(totalheight) + 'px'); 500 h2.css('top', '-' + parseInt(totalheight) + 'px'); 501 h3.css('top', '-' + parseInt(totalheight) + 'px'); 502 h4.css('top', '-' + parseInt(totalheight) + 'px'); 503 h5.css('top', '-' + parseInt(totalheight) + 'px'); 504 h6.css('top', '-' + parseInt(totalheight) + 'px'); 505 } 506 } 507 } else { 508 s.removeClass('stickp'); 509 w.removeClass("non-stickh"); 510 w.addClass("stickh"); 511 } 512 } 513 } 514 } 515 516 }); 517 } 518 519 if ($('#primary').find('div.rt-masonry-grid').length !== 0) { 520 521 var $grid = $('.rt-masonry-grid').imagesLoaded(function () { 522 masonaryGrid = $grid.masonry({ 523 // set itemSelector so .grid-sizer is not used in layout 524 itemSelector: '.rt-grid-item', 525 percentPosition: true, 526 isAnimated: true, 527 isRTL: true, 528 //originLeft: false, 529 animationOptions: { 530 duration: 700, 531 easing: 'linear', 532 queue: false 533 } 534 }); 535 masonaryGrid.masonry('layout'); 536 }); 537 } 538 539 /*VC JS*/ 540 /* Counter */ 541 if (typeof $.fn.counterUp == 'function') { 542 $('.rt-vc-counter .rt-counter , .rt-vc-counter-2 .rt-counter , .rt-vc-counter-3 .rt-counter, .rt-vc-counter-4 .rt-counter').counterUp({ 543 delay: $(this).data('rtSteps'), 544 time: $(this).data('rtSpeed') 545 }); 546 } 547 /* Infobox 1 */ 548 $(".rt-info-text-1").on({ 549 mouseenter: function () { 550 var hovercolor = $(this).data('hover'); 551 $(this).find(".pull-left i").css('color', hovercolor); 552 553 var bghovercolor = $(this).data('bghovercolor'); 554 $(this).find(".pull-left i").css('background-color', bghovercolor); 555 556 var title_hover = $(this).data('title-hover'); 557 $(this).find(".media-body h3, .media-body h3 a").css('color', title_hover); 558 }, 559 mouseleave: function () { 560 var color = $(this).data('color'); 561 $(this).find(".pull-left i").css('color', color); 562 563 $(this).find(".pull-left i").css('background-color', ''); 564 565 var title_color = $(this).data('title-color'); 566 $(this).find(".media-body h3, .media-body h3 a").css('color', title_color); 567 } 568 }, this); 569 570 /* Pricing Box 1 */ 571 $(".rt-price-table-box1").on({ 572 mouseenter: function () { 573 var bghover = $(this).data('bghover'); 574 $(this).css('background-color', bghover); 575 $(this).find(".rt-btn a , .price-holder , a.pricetable-btn").css('color', bghover); 576 577 }, 578 mouseleave: function () { 579 var bgcolor = $(this).data('bgcolor'); 580 $(this).css('background-color', bgcolor); 581 $(this).find(".rt-btn a").css('color', ''); 582 $(this).find(".price-holder").css('color', bgcolor); 583 $(this).find("a.pricetable-btn").css('color', '#f8f8f8'); 584 } 585 }, this); 586 587 /* Infobox 5 */ 588 $('.rt-infobox-5').each(function () { 589 var $column = $(this).closest('.vc_column-inner'); 590 var bgcolor = $column.css('background-color'); 591 var bghover = $(this).data('hover'); 592 $column.on({ 593 mouseenter: function () { 594 $column.attr('style', 'background-color: ' + bghover + ' !important'); 595 }, 596 mouseleave: function () { 597 $column.attr('style', 'background-color: ' + bgcolor + ' !important'); 598 } 599 }); 600 });
601 602 /* Woocommerce Shop change view */ 603 $('#shop-view-mode li a').on('click', function () { 604 $('body').removeClass('product-grid-view').removeClass('product-list-view'); 605 606 if ($(this).closest('li').hasClass('list-view-nav')) { 607 $('body').addClass('product-list-view'); 608 Cookies.set('shopview', 'list'); 609 } else { 610 $('body').addClass('product-grid-view'); 611 Cookies.remove('shopview'); 612 } 613 return false; 614 }); 615 616 // Popup - Used in video 617 if (typeof $.fn.magnificPopup == 'function') { 618 $('.rt-video-popup').magnificPopup({ 619 disableOn: 700, 620 type: 'iframe', 621 mainClass: 'mfp-fade', 622 removalDelay: 160, 623 preloader: false, 624 fixedContentPos: false 625 }); 626 } 627 628 if (typeof $.fn.magnificPopup == 'function') { 629 if ($('.zoom-gallery').length) { 630 $('.zoom-gallery').each(function () { // the containers for all your galleries 631 $(this).magnificPopup({ 632 delegate: 'a.ne-zoom', // the selector for gallery item 633 type: 'image', 634 gallery: { 635 enabled: true 636 } 637 }); 638 }); 639 } 640 } 641 642 // start the ticker 643 if (typeof $.fn.ticker == 'function') { 644 $('#rt-js-news').ticker({ 645 speed: ThemeObj.tickerSpeed, 646 debugMode: true, 647 controls: ThemeObj.tickerControl, 648 titleText: ThemeObj.tickerTitleText, 649 displayType: ThemeObj.tickerStyle, 650 direction: ThemeObj.tickerDirection, 651 pauseOnItems: ThemeObj.tickerDelay, 652 653 }); 654 } 655}); 656 657//function Load 658function barta_content_load_scripts() { 659 var $ = jQuery; 660 // Preloader 661 $('#preloader').fadeOut('slow', function () { 662 $(this).remove(); 663 }); 664 665 var windowWidth = $(window).width(); 666 667 /* Owl Custom Nav */ 668 if (typeof $.fn.owlCarousel == 'function') { 669 $(".owl-custom-nav .owl-next").on('click', function () { 670 $(this).closest('.owl-wrap').find('.owl-carousel').trigger('next.owl.carousel'); 671 }); 672 $(".owl-custom-nav .owl-prev").on('click', function () { 673 $(this).closest('.owl-wrap').find('.owl-carousel').trigger('prev.owl.carousel'); 674 }); 675 676 $(".rt-owl-carousel").each(function () { 677 var options = $(this).data('carousel-options'); 678 if (ThemeObj.rtl == 'yes') { 679 options['rtl'] = true; //@rtl 680 } 681 $(this).owlCarousel(options); 682 }); 683 684 685 } 686 687 /* Slider */ 688 if (typeof $.fn.nivoSlider == 'function') { 689 $('.rt-nivoslider , #ensign-nivoslider-3').nivoSlider({ 690 effect: 'boxRainReverse', 691 slices: 15, 692 boxCols: 8, 693 boxRows: 4, 694 animSpeed: 500, 695 pauseTime: 6000, 696 startSlide: 0, 697 autoplay: true, 698 directionNav: false, 699 controlNav: true, 700 controlNavThumbs: false, 701 pauseOnHover: false, 702 manualAdvance: false, 703 prevText: '', 704 nextText: '', 705 randomStart: false, 706 beforeChange: function () { 707 }, 708 afterChange: function () { 709 }, 710 slideshowEnd: function () { 711 }, 712 lastSlide: function () { 713 }, 714 afterLoad: function () { 715 } 716 }); 717 rdtheme_slider_fullscreen(); 718 } 719 720 if (typeof $.fn.slick == 'function') { 721 $(".slick-regular").slick(); 722 } 723 724} 725 726//function ready 727 728function rdtheme_slider_fullscreen() { 729 $ = jQuery; 730 $('.rt-el-slider').each(function () { 731 var width = $(window).width(), 732 left = $(this).offset().left, 733 $container = $(this).find('.rt-nivoslider'); 734 if (width < 1921) { 735 $container.css('margin-left', -left).width(width); 736 } else { 737 leftAlt = left - (width - 1920) / 2; 738 $container.css('margin-left', -leftAlt).width(1920); 739 } 740 $container.css('opacity', 1); 741 });
742} 743 744(function ($) { 745 "use strict"; 746 747 // Window Load+Resize 748 $(window).on('load resize', function () { 749 750 // Define the maximum height for mobile menu 751 var wHeight = $(window).height(); 752 wHeight = wHeight - 50; 753 $('.mean-nav > ul').css('max-height', wHeight + 'px'); 754 755 // Elementor Frontend Load 756 $(window).on('elementor/frontend/init', function () { 757 if (elementorFrontend.isEditMode()) { 758 elementorFrontend.hooks.addAction('frontend/element_ready/widget', function () { 759 barta_content_load_scripts(); 760 }); 761 } 762 }); 763 }); 764 765 // Window Load 766 $(window).on('load', function () { 767 barta_content_load_scripts(); 768 }); 769 770 $(window).on('scroll', scrollFunction); 771 772 function scrollFunction() { 773 var target = $('#contentHolder'); 774 775 if ( target.length > 0 ) { 776 var contentHeight = target.outerHeight(); 777 var documentScrollTop = $(document).scrollTop(); 778 var targetScrollTop = target.offset().top; 779 var scrolled = documentScrollTop - targetScrollTop; 780 781 if (0 <= scrolled) { 782 var scrolledPercentage = (scrolled / contentHeight) * 100; 783 if (scrolledPercentage >= 0 && scrolledPercentage <= 100) { 784 scrolledPercentage = scrolledPercentage >= 90 ? 100 : scrolledPercentage; 785 $("#bartaBar").css({ 786 width: scrolledPercentage + "%" 787 }); 788 } 789 } else { 790 $("#bartaBar").css({ 791 width: "0%" 792 }); 793 } 794 } 795 } 796 797})(jQuery); 798
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.