%PDF- %PDF-
Direktori : /var/www/html/sljcon/public/js/ |
Current File : /var/www/html/sljcon/public/js/function.js |
(function($){ 'use strict'; // Preloder $(window).on('load', function() { // makes sure the whole site is loaded $('body').removeClass('loading'); $('.image ').fadeOut(); // will first fade out the loading animation $('.image_text').fadeOut(); // will first fade out the loading animation $('#preloader').delay(360).fadeOut('slow'); // will fade out the white DIV that covers the website. $('body').delay(360).css({'overflow':'visible'}); }); // Top banner collapse $('#header .header_banner_icon').on('click', function(){ $('#header .header_banner').slideToggle(300); $(this).toggleClass('open'); }) // Sticky menu advanced var options = { offset: 300, offsetSide: 'top', classes: { clone: 'banner--clone', stick: 'banner--stick', unstick: 'banner--unstick' }, onInit: function(){ var clonedElement = this.clonedElem; var headerClass = $('#header').attr('class'); $(clonedElement).wrap('<header class="'+headerClass+'"></header>'); } }; // Initialise with options if ( $('#header .header_top_area.sticky').length ) var banner = new Headhesive('#header .header_top_area.sticky', options); // awesome features carousel if (!!$.prototype.owlCarousel) $('#awesome_features_carousel').owlCarousel({ loop: true, items: 4, dots: false, nav: false, onInitialized: function(event){ $(event.currentTarget).addClass('owl-carousel'); }, responsive : { 0 : { items: 1, }, 480 : { items: 1, }, 600 : { items: 2, }, 1024: { items: 3, }, 1200 : { items: 4, } } }); // popup zomm for portfolio or others if (!!$.prototype.magnificPopup) $('.magnific_popup').magnificPopup({ type: 'image', gallery:{ enabled:true }, mainClass: 'mfp-with-zoom', // this class is for CSS animation below }); /* our testimonials */ if (!!$.prototype.slick) $('#our_testimonial_slider .single_testimonial_item_top_carousel').slick({ dots: false, arrows: false, infinite: false, slidesToShow: 1, slidesToScroll: 1, centerMode: false, centerPadding: '0px', initialSlide: 1, asNavFor: '#our_testimonial_slider .single_testimonial_item_bottom_carousel', // speed: 300, // adaptiveHeight: true }); if (!!$.prototype.slick) $('#our_testimonial_slider .single_testimonial_item_bottom_carousel').slick({ dots: false, arrows: true, infinite: false, slidesToShow: 3, slidesToScroll: 1, centerMode: true, centerPadding: '0px', initialSlide: 1, asNavFor: '#our_testimonial_slider .single_testimonial_item_top_carousel', // speed: 300, // adaptiveHeight: true }); // counter number if( $('.number_counter').length ){ if (!!$.prototype.counterUp) $('.number_counter').counterUp({ // delay: 10, // time: 1000 }); } /* Aos animation */ AOS.init({ offset: -250, // duration: 600, // easing: 'ease-in-sine', // delay: 100, disable: window.innerWidth < 1024 }); // scroll to top $(window).scroll(function () { var winHeight = $(window).scrollTop() + $(window).height(); // Scroll to top function if(winHeight > $(window).height() + 400){ $('#scroll_top').fadeIn(); } else { $('#scroll_top').fadeOut(); } }); //scroll up event $('#scroll_top').on('click', function(e){ e.preventDefault(); $('body,html').stop().animate({ scrollTop:0 },1200,'easeInQuad') return false; }); // sidebar panel //sidebars handler for jillix // All sides var sides = ["left", "top", "right", "bottom"]; // Initialize sidebars for (var i = 0; i < sides.length; ++i) { var cSide = sides[i]; $(".sidebar_panel." + cSide).sidebar({side: cSide}); } // Click handlers $("body header").on("click", '.sidebar_nav_icon[data-action]', function () { var $this = $(this); var action = $this.attr("data-action"); var side = $this.attr("data-side"); $(".sidebar_panel." + side).trigger("sidebar:" + action); var panelWidth = parseInt($(".sidebar_panel." + side).css(side), 10)*-1; var options = {}; options[side] = panelWidth+'px'; $('#page').css({'position':'relative'}).animate(options, 200); $this.toggleClass('active'); $('body').toggleClass('open'); return false; }); // sidebar panel close $("#sidebar_panel").on("click", '.sidebar_nav_icon_close', function () { var $this = $(this); var action = $this.attr("data-action"); var side = $this.attr("data-side"); $(".sidebar_panel." + side).trigger("sidebar:" + action); var panelWidth = parseInt($(".sidebar_panel." + side).css(side), 10)*-1; var options = {}; options[side] = panelWidth+'px'; $('#page').css({'position':'relative'}).animate(options, 200); //$this.toggleClass('active'); //$('body').toggleClass('open'); return false; }); // TreeManegent $('ul.tree.dhtml').hide(); //to do not execute this script as much as it's called... if(!$('ul.tree.dhtml').hasClass('dynamized')) { //add growers to each ul.tree elements $('ul.tree.dhtml ul').prev().before("<span class='grower OPEN'> </span>"); //dynamically add the '.last' class on each last item of a branch $('ul.tree.dhtml ul li:last-child, ul.tree.dhtml li:last-child').addClass('last'); //collapse every expanded branch $('ul.tree.dhtml span.grower.OPEN').addClass('CLOSE').removeClass('OPEN').parent().find('ul:first').hide(); $('ul.tree.dhtml').show(); //open the tree for the selected branch $('ul.tree.dhtml .selected').parents().each( function() { if ($(this).is('ul')) toggleBranch($(this).prev().prev(), true); }); toggleBranch( $('ul.tree.dhtml .selected').prev(), true); //add a fonction on clicks on growers $('ul.tree.dhtml span.grower').on('click', function(){ toggleBranch($(this)); }); //mark this 'ul.tree' elements as already 'dynamized' $('ul.tree.dhtml').addClass('dynamized'); $('ul.tree.dhtml').removeClass('dhtml'); } //animate the opening of the branch (span.grower jQueryElement) function openBranch(jQueryElement, noAnimation) { jQueryElement.addClass('OPEN').removeClass('CLOSE'); if(noAnimation) jQueryElement.parent().find('ul:first').show(); else jQueryElement.parent().find('ul:first').slideDown(); } //animate the closing of the branch (span.grower jQueryElement) function closeBranch(jQueryElement, noAnimation) { jQueryElement.addClass('CLOSE').removeClass('OPEN'); if(noAnimation) jQueryElement.parent().find('ul:first').hide(); else jQueryElement.parent().find('ul:first').slideUp(); } //animate the closing or opening of the branch (ul jQueryElement) function toggleBranch(jQueryElement, noAnimation) { if(jQueryElement.hasClass('OPEN')) closeBranch(jQueryElement, noAnimation); else openBranch(jQueryElement, noAnimation); } // Main slider area if (typeof $Jssor$ != 'undefined'){ if (typeof(tess_homeslider_speed) == 'undefined') var tess_homeslider_speed = 500; if (typeof(tess_homeslider_pause) == 'undefined') var tess_homeslider_pause = 3000; if (typeof(tess_homeslider_loop) == 'undefined') var tess_homeslider_loop = true; if (typeof(tess_homeslider_fullwidth) == 'undefined') var tess_homeslider_fullwidth = false; var _CaptionTransitions = []; _CaptionTransitions["topBounce"] = {$Duration:1200,y:0.6,$Easing:{$Top:$JssorEasing$.$EaseInOutBack},$Opacity:2}; _CaptionTransitions["boxBounce"] = {$Duration:1200,$Rotate:1,$Easing:{$Rotate:$JssorEasing$.$EaseOutCubic},$Opacity:2,$During:{$Rotate:[0,0.5]}}; _CaptionTransitions["L"] = { $Duration: 600, x: 0.1, $Easing: { $Left: $JssorEasing$.$EaseInOutSine }, $Opacity: 2 }; _CaptionTransitions["R"] = { $Duration: 600, x: -0.1, $Easing: { $Left: $JssorEasing$.$EaseInOutSine }, $Opacity: 2 }; _CaptionTransitions["T"] = { $Duration: 900, y: 0.6, $Easing: { $Top: $JssorEasing$.$EaseInOutSine }, $Opacity: 2 }; _CaptionTransitions["B"] = { $Duration: 900, y: -0.6, $Easing: { $Top: $JssorEasing$.$EaseInOutSine }, $Opacity: 2 }; _CaptionTransitions["Fade"] = { $Duration: 600, x: 0.05, $Easing: { $Left: $JssorEasing$.$EaseInOutSine }, $Opacity: 2 }; _CaptionTransitions["ZMF|10"] = { $Duration: 900, $Zoom: 11, $Easing: { $Zoom: $JssorEasing$.$EaseOutQuad, $Opacity: $JssorEasing$.$EaseLinear }, $Opacity: 2 }; _CaptionTransitions["RTT|10"] = { $Duration: 900, $Zoom: 11, $Rotate: 1, $Easing: { $Zoom: $JssorEasing$.$EaseOutQuad, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseInExpo }, $Opacity: 2, $Round: { $Rotate: 0.8} }; _CaptionTransitions["RTT|2"] = { $Duration: 900, $Zoom: 3, $Rotate: 1, $Easing: { $Zoom: $JssorEasing$.$EaseInQuad, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseInQuad }, $Opacity: 2, $Round: { $Rotate: 0.5} }; _CaptionTransitions["RTTL|BR"] = { $Duration: 900, x: -0.6, y: -0.6, $Zoom: 11, $Rotate: 1, $Easing: { $Left: $JssorEasing$.$EaseInCubic, $Top: $JssorEasing$.$EaseInCubic, $Zoom: $JssorEasing$.$EaseInCubic, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseInCubic }, $Opacity: 2, $Round: { $Rotate: 0.8} }; _CaptionTransitions["CLIP|LR"] = { $Duration: 900, $Clip: 15, $Easing: { $Clip: $JssorEasing$.$EaseInOutCubic }, $Opacity: 2 }; _CaptionTransitions["MCLIP|L"] = { $Duration: 900, $Clip: 1, $Move: true, $Easing: { $Clip: $JssorEasing$.$EaseInOutCubic} }; _CaptionTransitions["MCLIP|R"] = { $Duration: 900, $Clip: 2, $Move: true, $Easing: { $Clip: $JssorEasing$.$EaseInOutCubic} }; var options = { $AutoPlaySteps: 1, $LazyLoading: 3, $FillMode: 2, //[Optional] The way to fill image in slide, 0 stretch, 1 contain (keep aspect ratio and put all inside slide), 2 cover (keep aspect ratio and cover whole slide), 4 actual size, 5 contain for large image, actual size for small image, default value is 0 $AutoPlay: false, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false $AutoPlayInterval: tess_homeslider_pause, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000 $PauseOnHover: 1, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, 4 freeze for desktop, 8 freeze for touch device, 12 freeze for desktop and touch device, default value is 1 $ArrowKeyNavigation: false, //[Optional] Allows keyboard (arrow key) navigation or not, default value is false $SlideEasing: $JssorEasing$.$EaseOutQuint, //[Optional] Specifies easing for right to left animation, default value is $JssorEasing$.$EaseOutQuad $SlideDuration: tess_homeslider_speed, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500 $MinDragOffsetToSlide: 20, //[Optional] Minimum drag offset to trigger slide , default value is 20 //$SlideWidth: 600, //[Optional] Width of every slide in pixels, default value is width of 'slides' container //$SlideHeight: 300, //[Optional] Height of every slide in pixels, default value is height of 'slides' container $SlideSpacing: 0, //[Optional] Space between each slide in pixels, default value is 0 $DisplayPieces: 1, //[Optional] Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), the default value is 1 $ParkingPosition: 0, //[Optional] The offset position to park slide (this options applys only when slideshow disabled), default value is 0. $UISearchMode: 1, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc). $PlayOrientation: 1, //[Optional] Orientation to play slide (for auto play, navigation), 1 horizental, 2 vertical, 5 horizental reverse, 6 vertical reverse, default value is 1 $DragOrientation: 1, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0) $CaptionSliderOptions: { //[Optional] Options which specifies how to animate caption $Class: $JssorCaptionSlider$, //[Required] Class to create instance to animate caption $CaptionTransitions: _CaptionTransitions, //[Required] An array of caption transitions to play caption, see caption transition section at jssor slideshow transition builder $PlayInMode: 3, //[Optional] 0 None (no play), 1 Chain (goes after main slide), 3 Chain Flatten (goes after main slide and flatten all caption animations), default value is 1 $PlayOutMode: 3 //[Optional] 0 None (no play), 1 Chain (goes before main slide), 3 Chain Flatten (goes before main slide and flatten all caption animations), default value is 1 }, $BulletNavigatorOptions: { //[Optional] Options to specify and enable navigator or not $Class: $JssorBulletNavigator$, //[Required] Class to create navigator instance $ChanceToShow: 0, //[Required] 0 Never, 1 Mouse Over, 2 Always $AutoCenter: 2, //[Optional] Auto center navigator in parent container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 0 $Steps: 1, //[Optional] Steps to go for each navigation request, default value is 1 $Lanes: 1, //[Optional] Specify lanes to arrange items, default value is 1 $SpacingX: 18, //[Optional] Horizontal space between each item in pixel, default value is 0 $SpacingY: 18, //[Optional] Vertical space between each item in pixel, default value is 0 $Orientation: 2 //[Optional] The orientation of the navigator, 1 horizontal, 2 vertical, default value is 1 }, $ArrowNavigatorOptions: { //[Optional] Options to specify and enable arrow navigator or not $Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always $AutoCenter: 0, //[Optional] Auto center arrows in parent container, 0 No, 1 Horizontal, 2 Vertical, 3 Both, default value is 0 $Steps: 1 //[Optional] Steps to go for each navigation request, default value is 1 } }; if( $('#slider1_container').length ){ var main_slider1 = new $JssorSlider$("slider1_container", options); // Force Full width function ScaleSliderFull() { var bodyWidth = $(window).width(); var parentPosLeft = $('#slider1_container').parent().offset().left; if (typeof bodyWidth != 'undefined' && typeof parentPosLeft != 'undefined'){ main_slider1.$SetScaleWidth(bodyWidth); $('#slider1_container').css({'left': -(parentPosLeft) + 'px'}); } else{ window.setTimeout(ScaleSlider, 30); } }; // responsive function ScaleSlider() { var parentWidth = $('#slider1_container').parent().width(); if (parentWidth) { main_slider1.$ScaleWidth(parentWidth); } else window.setTimeout(ScaleSlider, 30); }; if( tess_homeslider_fullwidth != false){ ScaleSliderFull(); //$(window).bind("load", ScaleSliderFull); $(window).bind("resize", ScaleSliderFull); $(window).bind("orientationchange", ScaleSliderFull); if (!navigator.userAgent.match(/(iPhone|iPod|iPad|BlackBerry|IEMobile)/)) { $(window).bind('resize', ScaleSliderFull); }; if (navigator.userAgent.match(/(iPhone|iPod|iPad)/)) { $(window).bind("orientationchange", ScaleSliderFull); }; } else{ $(window).bind("load", ScaleSlider); $(window).bind("resize", ScaleSlider); $(window).bind("orientationchange", ScaleSlider); if (!navigator.userAgent.match(/(iPhone|iPod|iPad|BlackBerry|IEMobile)/)) { $(window).bind('resize', ScaleSlider); }; if (navigator.userAgent.match(/(iPhone|iPod|iPad)/)) { $(window).bind("orientationchange", ScaleSlider); }; }; }; }; // script for pricing slide if( $('#slider-range').length ){ $( "#slider-range" ).slider({ range: true, min: 0, max: 500, values: [ 75, 300 ], slide: function( event, ui ) { $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] ); } }); $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " - $" + $( "#slider-range" ).slider( "values", 1 ) ); } // comming soon countdown if (!!$.prototype.countdown) $('.countdown').countdown({ render: function(data) { $(this.el).html("<div class='prod_count_label'></div><div class='countdown_list days'><span class='countdown_digit'>" + this.leadingZeros(data.days, 2) + "</span><span class='countdown_label'>days</span></div><div class='countdown_list hrs'><span class='countdown_digit'>" + this.leadingZeros(data.hours, 2) + "</span><span class='countdown_label'>hours</span></div><div class='countdown_list min'><span class='countdown_digit'>" + this.leadingZeros(data.min, 2) + "</span><span class='countdown_label'>minutes</span></div><div class='countdown_list sec'><span class='countdown_digit'>" + this.leadingZeros(data.sec, 2) + "</span><span class='countdown_label'>seconds</span></div>"); } }); $(window).on('load', function() { // makes sure the whole site is loaded if( $('#grid').length ){ $('#grid').siblings('.filter-options').children('button:first').trigger('click').addClass('active'); } }); })(jQuery); // Doc ready