PATH:
home
/
lab2454c
/
biocei.com
/
wp-content
/
themes
/
biocei
/
inc
/
js
(function ($) { $(document).ready(function () { let p = 3, pageNo = 1; $(window).scroll(function () { if ($(this).scrollTop() > 50) { $('.navbar__top').addClass('shrink'); } else { $('.navbar__top').removeClass('shrink'); } }) $('.carousel__value').owlCarousel({ margin: 0, autoplay: true, nav: false, loop: false, responsive: { 0: { items: 1 }, 500: { items: 1 }, 700: { items: 1 }, 1000: { items: 1 }, 1299: { items: 1 } } }) $('.carousel__portfolio').owlCarousel({ margin: 20, autoplay: true, nav: false, loop: false, responsive: { 0: { items: 1 }, 500: { items: 2 }, 700: { items: 2 }, 1000: { items: 3 }, 1299: { items: 3 } } }) $('.carousel__programs').owlCarousel({ margin: 20, autoplay: true, nav: false, loop: false, responsive: { 0: { items: 1 }, 500: { items: 1 }, 700: { items: 2 }, 1000: { items:2 }, 1299: { items: 3 } } }) $('.carousel__news').owlCarousel({ margin: 20, autoplay: true, nav: false, loop: false, responsive: { 0: { items: 1 }, 500: { items: 2 }, 700: { items: 2 }, 1000: { items: 3 }, 1299: { items: 3 } } }) $('.carousel__event').owlCarousel({ margin: 20, autoplay: true, nav: false, loop: false, responsive: { 0: { items: 1 }, 500: { items: 1 }, 700: { items: 1 }, 1000: { items: 1 }, 1299: { items: 1 } } }) $('.hamburger__menu').on('click', function () { $('.menu').toggleClass('animate'); }) function load_posts() { pageNo++; var str = '&pageNo=' + pageNo + '&ppp=' + p + '&action=more_post_ajax'; $.ajax({ type: "POST", dataType: "html", url: ajax_posts.ajaxurl, data: str, success: function (data) { var $data = $(data); if ($data.length) { $("#ajax-load-posts").append($data); //$("#load_more_posts").attr("disabled", false); } }, error: function (jqXHR, textStatus, errorThrown) { $loader.html(jqXHR + " :: " + textStatus + " :: " + errorThrown); } }); return false; } $("#load_more_posts").on("click", function () { // When btn is pressed. let btn = $(this), totalPost = parseInt(btn.data('posts')), totalPages = Math.ceil(totalPost/p) btn.attr("disabled", true); // Disable the button, temp. load_posts(); if(pageNo >= totalPages){ console.log(pageNo, totalPages); btn.attr("disabled", true) }else{ btn.attr("disabled", false) } btn.insertAfter('#ajax-posts'); // Move the 'Load More' button to the end of the the newly added posts. }); $('a[href="#search"]').on('click', function (event) { event.preventDefault(); $('#search').addClass('open'); $('#search > form > input[type="search"]').focus(); }); // $('#search, #search button.close').on('click keyup', function (event) { // if (event.target == this || event.target.className == 'close' || event.keyCode == 27) { // $(this).removeClass('open'); // } // }); $(".serach__wrapp > .close__btn").on('click', function(){ $(this).parent().removeClass('open') }) $('.search-fieldform-control').length && $('.search-fieldform-control').attr('required', true) //Do not include! This prevents the form from submitting for DEMO purposes only! // $('form').submit(function (event) { // event.preventDefault(); // return false; // }) $(".mega__dropdown__inner>a").on('click', function(e){ if($(window).width() <= 991){ e.preventDefault() $(this).next().toggle() } }) }) })(jQuery);
[+]
..
[-] scripts.js
[edit]
[-] owl.carousel.js
[edit]