Файловый менеджер - Редактировать - /home/beautybuzzbeyond/public_html/wp-content/themes/music-night/js/functions.js
Назад
jQuery(document).ready(function($){ "use strict"; /*================================================ Progress Bar bootstrap =================================================*/ $('.causes_slider-nav li a').on('click',function(event) { event.preventDefault(); }); /* ---------------------------------------------------------------------- */ /* CountDown Function /* ---------------------------------------------------------------------- */ window.jQuery(function ($) { if($('.kode-eventcountdown').length){ $('.kode-eventcountdown time').countDown({ with_separators: false }); } }); if($(".brk-slider").length){ $('.brk-slider').bxSlider({ minSlides: 2, maxSlides: 3, slideMargin: 30, slideWidth: true, ticker: true, onSliderLoad: function(){ $(".news_items").css("visibility", "visible"); }, speed: 30000 }); } /* ---------------------------------------------------------------------- */ /* Slide Menu /* ---------------------------------------------------------------------- */ if($('#c-button--slide-left').length){ var slideLeft = new Menu({ wrapper: '.body-wrapper', type: 'slide-left', menuOpenerClass: '.c-button', maskId: '#c-mask' }); var slideLeftBtn = document.querySelector('#c-button--slide-left'); slideLeftBtn.addEventListener('click', function(e) { e.preventDefault; slideLeft.open(); }); } // runs Slick slider function $.fn.musicnight_slickslider = function(){ if(typeof($.fn.slick) == 'function'){ $(this).each(function(){ var option; if($(this).attr('data-slide')){ option = $(this).attr('data-slide'); } var slick_attr = { infinite: true, speed: 200, autoplay:true, centerMode: false, centerPadding: '0px', vertical:false, slidesToShow: option, responsive: [ { breakpoint: 1900, settings: { arrows: true, centerMode: false, centerPadding: '0px', slidesToShow: 5 } }, { breakpoint: 1680, settings: { arrows: true, centerMode: false, centerPadding: '0px', slidesToShow: 5 } }, { breakpoint: 1366, settings: { arrows: true, centerMode: false, centerPadding: '0px', slidesToShow: 3 } }, { breakpoint: 768, settings: { arrows: true, centerMode: true, centerPadding: '0px', slidesToShow: 2 } }, { breakpoint: 481, settings: { arrows: true, centerMode: true, centerPadding: '0px', slidesToShow: 1 } } ], slidesToScroll: 1 }; $(this).slick(slick_attr); }); } } // runs Slick slider function $.fn.musicnight_slickslider_modern = function(){ if(typeof($.fn.slick) == 'function'){ $(this).each(function(){ var data_min; var data_max; var data_move; if($(this).attr('data-min')){ var data_min = $(this).attr('data-min'); } if($(this).attr('data-max')){ var data_max = $(this).attr('data-max'); } if($(this).attr('data-move')){ var data_move = $(this).attr('data-move'); } var slick_attr = { centerMode: false, arrows: true, dots: true, centerPadding: '0px', vertical: true, slidesToShow: 4, slidesToScroll: 1, responsive: [ { breakpoint: 1680, settings: { arrows: true, centerMode: false, centerPadding: '0px', slidesToShow: 3 } }, { breakpoint: 768, settings: { arrows: true, centerMode: true, centerPadding: '0px', slidesToShow: 2 } }, { breakpoint: 481, settings: { arrows: true, centerMode: true, centerPadding: '0px', slidesToShow: 2 } } ] }; $(this).slick(slick_attr); }); } } if($('.kode-product-slide').length){ $('.kode-product-slide').slick({ infinite: true, speed: 200, autoplay:true, slidesToShow: 1, }); } /* ====================================================== CHURECH TESTIMONIAL =======================================================*/ if($(".church_testimonial_slider").length){ $('.church_testimonial_slider').slick({ slidesToShow: 1, slidesToScroll: 1, arrows: false, dots: true, fade: false, asNavFor: '.church_testimonial_nav' }); } if($(".church_testimonial_nav").length){ $('.church_testimonial_nav').slick({ slidesToShow: 5, slidesToScroll: 5, asNavFor: '.church_testimonial_slider', dots: false, arrows: false, centerMode: true, focusOnSelect: true }); } /* ====================================================== CHURECH FULL SLIDER =======================================================*/ if($(".slider_full").length){ $(".slider_full").slick({ slidesToShow: 1, slidesToScroll: 1, autoplay: true, arrows: true }); } if($('.chosen-select').length){ $('.chosen-select').chosen(); } // runs countdown function $.fn.musicnight_countdown = function(){ if(typeof($.fn.countdown) == 'function'){ $(this).each(function(){ var austDay = new Date(); var data_year; var data_month; var data_day; var data_time; var current_day; // data-year duration if( $(this).attr('data-year') ){ data_year = parseInt($(this).attr('data-year')); } //Month if( $(this).attr('data-month') ){ data_month = parseInt($(this).attr('data-month')); } //day if( $(this).attr('data-day') ){ data_day = parseInt($(this).attr('data-day')); } //time if( $(this).attr('data-time') ){ data_time = parseInt($(this).attr('data-time')); } current_day = new Date(data_year, data_month-1, data_day,data_time); $(this).countdown({until: current_day}); jQuery('#year').text(current_day.getFullYear()); }); } } // runs countdown function $.fn.musicnight_countdown_timmer = function(){ if(typeof($.fn.downCount) == 'function'){ $(this).each(function(){ var austDay = new Date(); var data_year; var data_month; var data_day; var data_time; var current_day; // data-year duration if( $(this).attr('data-year') ){ data_year = parseInt($(this).attr('data-year')); } //Month if( $(this).attr('data-month') ){ data_month = parseInt($(this).attr('data-month')); } //day if( $(this).attr('data-day') ){ data_day = parseInt($(this).attr('data-day')); } //time if( $(this).attr('data-time') ){ data_time = parseInt($(this).attr('data-time')); } var current_day = new Date(data_year, data_month-1, data_day,data_time); $(this).downCount({ date: current_day, offset: +1 }); }); } } /* ---------------------------------------------------------------------- */ /* Bx Slider /* ---------------------------------------------------------------------- */ if($(".bxslider2").length){ $('.bxslider2').bxSlider({ auto:true, onSliderLoad: function(){ $(".item").css("visibility", "visible"); } }); } /* ---------------------------------------------------------------------- */ /* Bx Slider Thumbnail /* ---------------------------------------------------------------------- */ if($(".bxslider-thums").length){ $('.bxslider-thums').bxSlider({ auto:true, onSliderLoad: function(){ $(".item").css("visibility", "visible"); }, pagerCustom: '#bx-pager' }); } if($("select").length){ $('select:not(.ignore)').niceSelect(); } // runs bx slider function $.fn.musicnight_bxslider = function(){ if(typeof($.fn.bxSlider) == 'function'){ $(this).each(function(){ var bx_attr = { mode: 'slide', auto: true, speed: 500, slideMargin:20, infiniteLoop: true, pager: true, controls: true, onSliderLoad: function(){ $(".music_banner").css("visibility", "visible"); }, pagerCustom: '#bx-pager', }; // slide duration if( $(this).attr('data-pausetime') ){ bx_attr.pause = parseInt($(this).attr('data-pausetime')); } if( $(this).attr('data-slidespeed') ){ bx_attr.speed = parseInt($(this).attr('data-slidespeed')); } if( $(this).attr('data-mode') ){ bx_attr.mode = $(this).attr('data-mode'); } if( $(this).attr('data-min') ){ bx_attr.minSlides = parseInt($(this).attr('data-min')); } if( $(this).attr('data-width') ){ bx_attr.slideWidth = $(this).attr('data-width'); } if( $(this).attr('data-max') ){ bx_attr.maxSlides = parseInt($(this).attr('data-max')); } if( $(this).attr('data-margin') ){ bx_attr.slideMargin = $(this).attr('data-margin'); } if( $(this).attr('data-move') ){ bx_attr.moveSlides = $(this).attr('data-move'); } if( $(this).attr('data-auto') ){ bx_attr.auto = $(this).attr('data-auto'); } if( $(this).attr('data-ticker') ){ bx_attr.ticker = false; } if( $(this).attr('data-tickerHover') ){ bx_attr.tickerHover = $(this).attr('data-tickerHover'); } $(this).bxSlider(bx_attr); }); $(".bx-controls-direction .bx-prev").empty(); $(".bx-controls-direction .bx-next").empty(); $(".bx-controls-direction .bx-next").append('<i class="fa fa-angle-right"></i>'); $(".bx-controls-direction .bx-prev").append('<i class="fa fa-angle-left"></i>'); } } // runs bx slider function $.fn.musicnight_bxslider_pager = function(){ if(typeof($.fn.bxSlider) == 'function'){ $(this).each(function(){ var bx_attr = { mode: 'slide', auto: true, speed: 500, slideMargin:20, infiniteLoop: true, pager: true, controls: true, onSliderLoad: function(){ $(".item").css("visibility", "visible"); }, pagerCustom: '#kode-bxslider-nav', }; $(this).bxSlider({pagerCustom: '#kode-bxslider-nav'}); }); } } // runs bx slider function $.fn.musicnight_bxslider_no_awesome = function(){ if(typeof($.fn.bxSlider) == 'function'){ $(this).each(function(){ var bx_attr = { mode: 'slide', auto: true, speed: 500, slideMargin:20, infiniteLoop: true, pager: false, controls: true, onSliderLoad: function(){ $(".item").css("visibility", "visible"); }, }; // slide duration if( $(this).attr('data-pausetime') ){ bx_attr.pause = parseInt($(this).attr('data-pausetime')); } if( $(this).attr('data-slidespeed') ){ bx_attr.speed = parseInt($(this).attr('data-slidespeed')); } if( $(this).attr('data-mode') ){ bx_attr.mode = $(this).attr('data-mode'); } if( $(this).attr('data-min') ){ bx_attr.minSlides = parseInt($(this).attr('data-min')); } if( $(this).attr('data-width') ){ bx_attr.slideWidth = parseInt($(this).attr('data-width')); } if( $(this).attr('data-max') ){ bx_attr.maxSlides = parseInt($(this).attr('data-max')); } if( $(this).attr('data-margin') ){ bx_attr.slideMargin = parseInt($(this).attr('data-margin')); } if( $(this).attr('data-move') ){ bx_attr.moveSlides = $(this).attr('data-move'); } if( $(this).attr('data-auto') ){ bx_attr.auto = $(this).attr('data-auto'); } if( $(this).attr('data-ticker') ){ bx_attr.ticker = false; } if( $(this).attr('data-tickerHover') ){ bx_attr.tickerHover = $(this).attr('data-tickerHover'); } $(this).bxSlider(bx_attr); }); $(".bx-controls-direction .bx-prev").empty(); $(".bx-controls-direction .bx-next").empty(); } } /* ======================================================================= Navigation ======================================================================= */ if($('.sticky-nav').length){ // grab the initial top offset of the navigation var stickyNavTop = $('.sticky-nav').offset().top; // our function that decides weather the navigation bar should have "fixed" css position or not. var stickyNav = function(){ var scrollTop = $(window).scrollTop(); // our current vertical position from the top // if we've scrolled more than the navigation, change its position to fixed to stick to top, // otherwise change it back to relative if (scrollTop > stickyNavTop) { $('.sticky-nav').addClass('kf_sticky'); } else { $('.sticky-nav').removeClass('kf_sticky'); } }; stickyNav(); // and run it again every time you scroll $(window).scroll(function() { stickyNav(); }); } if($('.sticky-post-left').length){ // grab the initial top offset of the navigation var stickyNavTop = $('.kode-post-nav').offset().top; // our function that decides weather the navigation bar should have "fixed" css position or not. var stickyNav = function(){ var scrollTop = $(window).scrollTop(); // our current vertical position from the top // if we've scrolled more than the navigation, change its position to fixed to stick to top, // otherwise change it back to relative if (scrollTop > stickyNavTop) { $('.sticky-post-left').addClass('sticky_post_left'); } else { $('.sticky-post-left').removeClass('sticky_post_left'); } }; stickyNav(); // and run it again every time you scroll $(window).scroll(function() { stickyNav(); }); } if($('.nav_one_page').length){ $('.navigation .menu').singlePageNav({ offset: 60, filter: ':not(li.external a)', updateHash: true, beforeStart: function() { console.log('begin scrolling'); }, onComplete: function() { console.log('done scrolling'); } }); } //Click event to scroll to top $('#child-topbtn').on('click',function(){ $('html, body').animate({scrollTop : 0},800); return false; }); // script for parallax background $('.kode-parallax-wrapper').each(function(){ if( $(this).hasClass('kode-background-image') ){ var parallax_section = $(this); var parallax_speed = parseFloat(parallax_section.attr('data-bgspeed')); if( parallax_speed == 0 || musicnight_touch_device ) return; if( parallax_speed == -1 ){ parallax_section.css('background-attachment', 'fixed'); parallax_section.css('background-position', 'center center'); return; } $(window).scroll(function(){ // if in area of interest if( ( $(window).scrollTop() + $(window).height() > parallax_section.offset().top ) && ( $(window).scrollTop() < parallax_section.offset().top + parallax_section.outerHeight() ) ){ var scroll_pos = 0; if( $(window).height() > parallax_section.offset().top ){ scroll_pos = $(window).scrollTop(); }else{ scroll_pos = $(window).scrollTop() + $(window).height() - parallax_section.offset().top; } parallax_section.css('background-position', 'center ' + (-scroll_pos * parallax_speed) + 'px'); } }); }else if( $(this).hasClass('kode-background-video') ){ if(typeof($.fn.mb_YTPlayer) == 'function'){ $(this).children('.kode-bg-player').mb_YTPlayer(); } }else{ return; } }); // responsive menu if(typeof($.fn.dlmenu) == 'function'){ $('#kode-responsive-navigation').each(function(){ $(this).find('.dl-submenu').each(function(){ if( $(this).siblings('a').attr('href') && $(this).siblings('a').attr('href') != '#' ){ var parent_nav = $('<li class="menu-item kode-parent-menu"></li>'); parent_nav.append($(this).siblings('a').clone()); $(this).prepend(parent_nav); } }); $(this).dlmenu(); }); } // gallery thumbnail type $('.kode-gallery-thumbnail').each(function(){ var thumbnail_container = $(this).children('.kode-gallery-thumbnail-container'); $(this).find('.gallery-item').on('click',function(){ var selected_slide = thumbnail_container.children('[data-id="' + $(this).attr('data-id') + '"]'); if(selected_slide.css('display') == 'block') return false; // check the gallery height var image_width = selected_slide.children('img').attr('width'); var image_ratio = selected_slide.children('img').attr('height') / image_width; var temp_height = image_ratio * Math.min(thumbnail_container.width(), image_width); thumbnail_container.animate({'height': temp_height}); selected_slide.fadeIn().siblings().hide(); return false; }); $(window).resize(function(){ thumbnail_container.css('height', 'auto') }); }); /* ---------------------------------------------------------------------- */ /* Carousel /* ---------------------------------------------------------------------- */ $.fn.musicnight_owl_carousel = function(){ if(typeof($.fn.owlCarousel) == 'function'){ $(this).each(function(){ var option, data_small, data_margin, data_medium; if($(this).attr('data-slide')){ option = $(this).attr('data-slide'); } if($(this).attr('data-small-slide')){ data_small = $(this).attr('data-small-slide'); } if($(this).attr('data-medium-slide')){ data_medium = $(this).attr('data-medium-slide'); } if($(this).attr('data-margin')){ data_margin = parseInt($(this).attr('data-margin')); } var owl_attr = { autoPlay: 3000, //Set AutoPlay to 3 seconds margin:data_margin, responsive:{ 0:{ items:data_small }, 600:{ items:data_small }, 1000:{ items:data_medium }, 1500:{ items:option } } }; $(this).owlCarousel(owl_attr); }); } } /* ---------------------------------------------------------------------- */ /* Carousel /* ---------------------------------------------------------------------- */ $.fn.musicnight_owl_carousel_modern = function(){ if(typeof($.fn.owlCarousel) == 'function'){ $(this).each(function(){ var data_min, data_max, data_margin, data_med; if($(this).attr('data-min')){ var data_min = $(this).attr('data-min'); } if($(this).attr('data-max')){ var data_max = $(this).attr('data-max'); } if($(this).attr('data-medium')){ var data_med = $(this).attr('data-medium'); } if($(this).attr('data-margin')){ data_margin = parseInt($(this).attr('data-margin')); } var owl_attr = { autoPlay: 3000, //Set AutoPlay to 3 seconds margin:data_margin, responsive:{ 0:{ items:1 }, 600:{ items:data_min }, 1000:{ items:data_med }, 1500:{ items:data_max } } }; $(this).owlCarousel(owl_attr); }); } } /* ---------------------------------------------------------------------- */ /* Carousel /* ---------------------------------------------------------------------- */ $.fn.musicnight_owl_carousel_no_space = function(){ if(typeof($.fn.owlCarousel) == 'function'){ $(this).each(function(){ var option; var data_small; var data_margin; if($(this).attr('data-slide')){ option = $(this).attr('data-slide'); } if($(this).attr('data-small-slide')){ data_small = $(this).attr('data-small-slide'); } if($(this).attr('data-margin')){ data_margin = $(this).attr('data-margin'); } var nice_attr = { autoPlay: 3000, //Set AutoPlay to 3 seconds responsive:{ 0:{ items:1 }, 600:{ items:data_small }, 1000:{ items:option } } }; $(this).owlCarousel(nice_attr); }); } } // runs flex slider function $.fn.musicnight_flexslider = function(){ if(typeof($.fn.flexslider) == 'function'){ $(this).each(function(){ var flex_attr = { animation: 'fade', animationLoop: true, prevText: '<i class="fa fa-angle-left" ></i>', nextText: '<i class="fa fa-angle-right" ></i>', useCSS: false }; // slide duration if( $(this).attr('data-pausetime') ){ flex_attr.slideshowSpeed = parseInt($(this).attr('data-pausetime')); } if( $(this).attr('data-slidespeed') ){ flex_attr.animationSpeed = parseInt($(this).attr('data-slidespeed')); } // set the attribute for carousel type if( $(this).attr('data-type') == 'carousel' ){ flex_attr.move = 1; flex_attr.animation = 'slide'; if( $(this).closest('.kode-item-no-space').length > 0 ){ flex_attr.itemWidth = $(this).width() / parseInt($(this).attr('data-columns')); flex_attr.itemMargin = 0; }else{ flex_attr.itemWidth = (($(this).width() + 30) / parseInt($(this).attr('data-columns'))) - 30; flex_attr.itemMargin = 30; } // if( $(this).attr('data-columns') == "1" ){ flex_attr.smoothHeight = true; } }else{ if( $(this).attr('data-effect') ){ flex_attr.animation = $(this).attr('data-effect'); } } if( $(this).attr('data-columns') ){ flex_attr.minItems = parseInt($(this).attr('data-columns')); flex_attr.maxItems = parseInt($(this).attr('data-columns')); } // set the navigation to different area if( $(this).attr('data-nav-container') ){ var flex_parent = $(this).parents('.' + $(this).attr('data-nav-container')).prev('.kode-nav-container'); if( flex_parent.find('.kode-flex-prev').length > 0 || flex_parent.find('.kode-flex-next').length > 0 ){ flex_attr.controlNav = false; flex_attr.directionNav = false; flex_attr.start = function(slider){ flex_parent.find('.kode-flex-next').on('click',function(){ slider.flexAnimate(slider.getTarget("next"), true); }); flex_parent.find('.kode-flex-prev').on('click',function(){ slider.flexAnimate(slider.getTarget("prev"), true); }); musicnight_set_item_outer_nav(); $(window).resize(function(){ musicnight_set_item_outer_nav(); }); } }else{ flex_attr.controlNav = false; flex_attr.controlsContainer = flex_parent.find('.nav-container'); } } $(this).flexslider(flex_attr); }); } } // runs bx slider function $.fn.musicnight_nicescroll = function(){ if(typeof($.fn.niceScroll) == 'function'){ $(this).each(function(){ var data_cursor = '12px'; var data_cursor_color = "#1C265B"; var data_cursor_opacity = 0.7; var data_cursor_border_color = '1px solid #1C265B'; if( $(this).attr('data-cursor-width') ){ var data_cursor = $(this).attr('data-cursor-width'); } if( $(this).attr('data-cursor-color') ){ var data_cursor_color = $(this).attr('data-cursor-color'); } if( $(this).attr('data-cursor-opacity') ){ var data_cursor_opacity = parseInt($(this).attr('data-cursor-opacity')); } if( $(this).attr('data-cursor-border-color') ){ var data_cursor_border_color = $(this).attr('data-cursor-border-color'); } $(this).niceScroll({cursorwidth:data_cursor,cursorcolor:data_cursor_color,cursoropacitymax:data_cursor_opacity,boxzoom:true,touchbehavior:false,cursorborder :data_cursor_border_color,zindex :999999}); }); } } // runs nivo slider function $.fn.musicnight_nivoslider = function(){ if(typeof($.fn.nivoSlider) == 'function'){ $(this).each(function(){ var nivo_attr = {}; if( $(this).attr('data-pausetime') ){ nivo_attr.pauseTime = parseInt($(this).attr('data-pausetime')); } if( $(this).attr('data-slidespeed') ){ nivo_attr.animSpeed = parseInt($(this).attr('data-slidespeed')); } if( $(this).attr('data-effect') ){ nivo_attr.effect = $(this).attr('data-effect'); } $(this).nivoSlider(nivo_attr); }); } } $('.divine_woo_dropdown_icon .widget_shopping_cart_content').hide(); //Header Search Area Function $('.divine_woo_dropdown_icon a').on('click',function () { if ($(this).attr('id') == 'active-btn-shopping') { $(this).attr('id', 'no-active-btn-shopping'); $(this).siblings('.widget_shopping_cart_content').slideUp(); } else { $(this).attr('id', 'active-btn-shopping'); $(this).siblings('.widget_shopping_cart_content').slideDown(); } }); $('.nivoSlider').musicnight_nivoslider(); $('.flexslider').musicnight_flexslider(); $('.bxslider_no').musicnight_bxslider_no_awesome(); $('.owl-carousel').musicnight_owl_carousel(); $('.owl-no-space').musicnight_owl_carousel_no_space(); // $('.event_countdown').musicnight_countdown(); $('.downcount').musicnight_countdown_timmer(); $('.event_countdown').musicnight_countdown_timmer(); $('.countdown-modern').musicnight_countdown_timmer(); $('.kode-bxslider-pager').musicnight_bxslider_pager(); $('.scholors-slider').musicnight_slickslider(); $('.kode-client-slide').musicnight_slickslider(); $('.donors-silde').musicnight_slickslider(); $('.coming-event-slide').musicnight_slickslider(); $('.kode-team-slide').musicnight_slickslider(); if($("[data-rel^='prettyPhoto']").length){ $("[data-rel^='prettyPhoto']").prettyPhoto(); } $('.main-slider-horizontal').musicnight_owl_carousel_modern(); $('.main-slider-vertical').musicnight_slickslider_modern(); // runs niceScroll when available $('.nicescroll').musicnight_nicescroll(); $('.jp-playlist-container').musicnight_nicescroll(); $(window).on('load',function() { $('.bxslider').musicnight_bxslider(); $("#kode-loader-wrapper").fadeOut(500); $("body").removeClass('kode-loader'); }); if($('.sticky-sidebar-enable').length){ $('.kode-content-area, .kode-left-sidebar-area, .kode-right-sidebar-area, .wpmf-left-sidebar-area, .wpmf-right-sidebar-area,.wpmf-content-area') .sticky_sidebar_script({ additionalMarginTop: 70 }); } $.fn.musicnight_show_tooltip = function(){ $('[data-toggle="tooltip"]').tooltip({trigger: 'manual'}).tooltip('show'); } $('.progress-bar').musicnight_show_tooltip(); });
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка