1// from Mazel template 2 3$(function () { 4 "use strict"; 5 6 7 8 9 10 // ----------------------------------------------------------------------------------------------------------------------------> 11 // GENERAL SCRIPTS FOR ALL PAGES ||----------- 12 // ----------------------------------------------------------------------------------------------------------------------------> 13 14 $(document).ready(function () { 15 fullScreenSlider(); 16 17 sliderHero(); 18 sliderAll(); 19 20 21 }); 22 23 24 $(window).resize(function () { 25 stickHeader(); 26 int_introHeight(); 27 }) 28 29 30 $(window).scroll(function () { 31 stickHeader(); 32 }); 33 34 35 36 37 38 // ----------------------------------------------------------------------------------------------------------------------------> 39 // SCROLL FUNCTIONS ||----------- 40 // ----------------------------------------------------------------------------------------------------------------------------> 41 42 function scroll() { 43 44 // //Click Event to Scroll to Top 45 $(window).scroll(function () { 46 if ($(this).scrollTop() > 300) { 47 $('.scroll-top').fadeIn(); 48 } else { 49 $('.scroll-top').fadeOut(); 50 } 51 52 53 }); 54 $('.scroll-top').click(function () { 55 $('html, body').animate({ scrollTop: 0 }, 800); 56 return false; 57 }); 58 59 // Scroll Down Elements 60 $('.scroll-down[href^="#"], .scroll-to-target[href^="#"]').on('click', function (e) { 61 e.preventDefault(); 62 63 var target = this.hash; 64 var $target = $(target); 65 66 $('html, body').stop().animate({ 67 'scrollTop': $target.offset().top 68 }, 900, 'swing', function () { 69 window.location.hash = target; 70 }); 71 }); 72 73 }; 74 75 76 // ----------------------------------------------------------------------------------------------------------------------------> 77 // STICKY HEADER FUNCTIONS ||----------- 78 // ----------------------------------------------------------------------------------------------------------------------------> 79 function stickHeader() { 80 81 var scrolled = $(window).scrollTop(); 82 var windHeight = $(window).height(); 83 if (scrolled > 150) { 84 $('.header').addClass('header-prepare'); 85 } else { 86 $('.header').removeClass('header-prepare'); 87 } 88 89 if (scrolled > 1) { 90 $('.header').addClass('header-fixed'); 91 } else { 92 $('.header').removeClass('header-fixed'); 93 } 94 }; 95 96 // ---------------------------------------------------------------- 97 // Intro Height 98 // ---------------------------------------------------------------- 99 function int_introHeight() { 100 var windiwHeight = $(window).height(); 101 // Intro Height 102 $('.js-fullscreen-height').css('height', windiwHeight); 103 }; 104 105 // ---------------------------------------------------------------- 106 // Backgrounds Image (Slider, Section, etc..) 107 // ---------------------------------------------------------------- 108 var pageSection = $('.slide-bg-image, .bg-image'); 109 pageSection.each(function (indx) { 110 111 if ($(this).attr("data-background-img")) { 112 $(this).css("background-image", "url(" + $(this).data("background-img") + ")"); 113 } 114 }); 115 116 // ----------------------------------------------------------------------------------------------------------------------------> 117 // FULLSCREEN SLIDER FUNCTIONS ||----------- 118 // ----------------------------------------------------------------------------------------------------------------------------> 119 function fullScreenSlider() { 120 if ($('.fullscreen-carousel').length > 0) { 121 122 $('.fullscreen-carousel').flexslider({ 123 animation: "slide", 124 // startAt: 0, 125 animationSpeed: 700, 126 animationLoop: true, 127 slideshow: true, 128 easing: "swing", 129 controlNav: false, 130 before: function (slider) { 131 //Slide Caption Animate 132 $('.fullscreen-carousel .intro-content-inner').fadeOut().animate({ top: '80px' }, { queue: false, easing: 'easeOutQuad', duration: 700 }); 133 slider.slides.eq(slider.currentSlide).delay(400); 134 slider.slides.eq(slider.animatingTo).delay(400); 135 136 }, 137 after: function (slider) { 138 //Slide Caption Animate 139 $('.fullscreen-carousel .flex-active-slide').find('.intro-content-inner').fadeIn(2000).animate({ top: '0' }, { queue: false, easing: 'easeOutQuad', duration: 1200 }); 140 141 // Header Dark Light
142 headerDarkLight_with_flexslider(); 143 144 }, 145 start: function (slider) { 146 $('body').removeClass('loading'); 147 148 // Header Dark Light 149 headerDarkLight_with_flexslider(); 150 151 }, 152 useCSS: true, 153 }); 154 }; 155 156 // Header Dark Light 157 function headerDarkLight_with_flexslider() { 158 159 var color = $('.fullscreen-carousel').find('li.flex-active-slide').attr('data-slide'); 160 if (color == 'dark-slide') { 161 $('#header').addClass('header').removeClass('header-light'); 162 $('#header').removeClass('header-default'); 163 } 164 if (color == 'light-slide') { 165 $('#header').addClass('header-light').removeClass('header-dark'); 166 $('#header').removeClass('header-default'); 167 } 168 if (color == 'default-slide') { 169 $('#header').removeClass('header-dark'); 170 $('#header').removeClass('header-light'); 171 $('#header').addClass('header'); 172 } 173 }; 174 175 // "fullscreen-carousel" height 176 fullScreenCarousel(); 177 function fullScreenCarousel() { 178 var windowWidth = $(window).width(); 179 var windowHeight = $(window).height(); 180 181 if ($(window).width() > 767) { 182 $('.hero-slider-1 .slides .js-Slide-fullscreen-height').css("height", windowHeight); 183 } 184 else { 185 $('.hero-slider-1 .slides .js-Slide-fullscreen-height').css("height", '400px'); 186 } 187 188 }; 189 $(window).resize(function () { 190 fullScreenCarousel(); 191 }); 192 193 194 }; 195 196 // ----------------------------------------------------------------------------------------------------------------------------> 197 // SLIDER FUNCTIONS ||----------- 198 // ----------------------------------------------------------------------------------------------------------------------------> 199 200 function sliderAll() { 201 202 // fullwidth Slider 203 $('.fullwidth-slider').owlCarousel({ 204 slideSpeed: 400, 205 singleItem: true, 206 autoHeight: true, 207 navigation: true, // Show next and prev buttons 208 pagination: true, // Show pagination buttons 209 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 210 211 }); 212 213 // Image Slider 214 $('.image-slider').owlCarousel({ 215 navigation: true, // Show next and prev buttons 216 pagination: true, // Show pagination buttons 217 slideSpeed: 350, 218 paginationSpeed: 400, 219 singleItem: true, 220 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 221 autoPlay: false, 222 autoHeight: true, 223 responsive: true 224 }); 225 226 // Testimonial Slider 227 $('.testimonial-carousel').owlCarousel({ 228 autoPlay: true, 229 autoHeight: true, 230 stopOnHover: true, 231 singleItem: true, 232 slideSpeed: 350, 233 pagination: true, // Show pagination buttons 234 navigation: false, // Hide next and prev buttons 235 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 236 // responsive: true 237 }); 238 239 // Team Carousel 240 $('.team-carousel').owlCarousel({ 241 autoPlay: false, 242 stopOnHover: true, 243 items: 3, 244 itemsDesktop: [1170, 3], 245 itemsDesktopSmall: [1024, 2], 246 itemsTabletSmall: [768, 1], 247 itemsMobile: [480, 1], 248 pagination: false, // Hide pagination buttons 249 navigation: false, // Hide next and prev buttons 250 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 251 }); 252 253 // Client Carousel
254 $('.client-carousel').owlCarousel({ 255 autoPlay: 2500, 256 stopOnHover: true, 257 items: 5, 258 itemsDesktop: [1170, 4], 259 itemsDesktopSmall: [1024, 3], 260 itemsTabletSmall: [768, 2], 261 itemsMobile: [480, 1], 262 pagination: false, // hide pagination buttons 263 navigation: false, // hide next and prev buttons 264 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 265 }); 266 267 // Content Slider 268 $('.content-carousel').owlCarousel({ 269 autoPlay: true, 270 autoHeight: true, 271 stopOnHover: true, 272 singleItem: true, 273 slideSpeed: 500, 274 pagination: false, // Hide pagination buttons 275 navigation: true, // Show next and prev buttons 276 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 277 responsive: true 278 }); 279 280 // Item-5 Carousel 281 $('.item5-carousel').owlCarousel({ 282 autoPlay: 2500, 283 stopOnHover: true, 284 items: 5, 285 itemsDesktop: [1170, 3], 286 itemsDesktopSmall: [1024, 2], 287 itemsTabletSmall: [768, 1], 288 itemsMobile: [480, 1], 289 pagination: true, // Show pagination buttons 290 navigation: true, // Show next and prev buttons 291 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 292 }); 293 294 // Item-4 Carousel 295 $('.item4-carousel').owlCarousel({ 296 autoPlay: 2500, 297 stopOnHover: true, 298 items: 4, 299 itemsDesktop: [1170, 3], 300 itemsDesktopSmall: [1024, 2], 301 itemsTabletSmall: [768, 1], 302 itemsMobile: [480, 1], 303 pagination: false, // Hide pagination buttons 304 navigation: true, // Show next and prev buttons 305 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 306 }); 307 308 // Item-3 Carousel 309 $('.item3-carousel').owlCarousel({ 310 autoPlay: false, 311 stopOnHover: true, 312 items: 3, 313 itemsDesktop: [1170, 3], 314 itemsDesktopSmall: [1024, 2], 315 itemsTabletSmall: [768, 1], 316 itemsMobile: [480, 1], 317 pagination: true, // show pagination buttons 318 navigation: true, // Show next and prev buttons 319 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"] 320 }); 321 322 // Item-1 Carousel 323 $('.item1-carousel').owlCarousel({ 324 autoPlay: false, 325 autoHeight: true, 326 stopOnHover: true, 327 singleItem: true, 328 slideSpeed: 350, 329 pagination: true, // Show pagination buttons 330 navigation: true, // Show next and prev buttons 331 navigationText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 332 responsive: true 333 }); 334 335 }; 336 337 338 339 // ----------------------------------------------------------------------------------------------------------------------------> 340 // SLIDER-HERO FUNCTIONS ||----------- 341 // ----------------------------------------------------------------------------------------------------------------------------> 342 343 function sliderHero() { 344 345 $('.slider-hero').owlCarousel({ 346 navigation: true, // Show next and prev buttons 347 slideSpeed: 700, 348 paginationSpeed: 400, 349 pagination: true, 350 addClassActive: true, 351 352 touchDrag: true, 353 singleItem: true, 354 navigationText: false, 355 autoPlay: false, 356 autoHeight: false, 357 358 //responsive: true, 359 //itemsDesktop: [3000, 1], 360 //itemsDesktopSmall: [1440, 1], 361 //itemsTablet: [1024, 1], 362 //itemsTabletSmall: [600, 1], 363 //itemsMobile: [360, 1], 364 365 beforeMove: beforeMove, 366 afterMove: afterMove, 367 afterInit: afterInit 368 369 }); 370 function beforeMove() { 371 $('.slider-hero .overlay-hero .caption-hero').fadeOut(1);
372 373 } 374 function afterMove() { 375 $('.slider-hero .owl-item.active ').find('.caption-hero').delay(500).fadeIn(1500); 376 BackgroundCheck.refresh(); 377 378 } 379 function afterInit() { 380 $('.slider-hero .owl-item.active ').find('.caption-hero').delay(500).fadeIn(1500); 381 BackgroundCheck.init({ 382 targets: '.full-intro', 383 images: '.owl-carousel .item img', 384 385 }); 386 387 } 388 389 $(window).height(function () { 390 heroResize(); 391 function heroResize() { 392 var windowHeight = $(window).innerHeight(); 393 $('.slider-hero, .full-screen-intro').css('height', windowHeight); 394 }; 395 $(window).resize(function () { 396 heroResize(); 397 }); 398 }); 399 400 }; 401}); 402 403
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.