1jQuery(function($) { 2 "use strict"; 3 4 var SLZ = window.SLZ || {}; 5 6 /*======================================= 7 = MAIN FUNCTION = 8 =======================================*/ 9 10 SLZ.fancyboxFunction = function() { 11 // It is no small thumbs 12 if($('.fancybox').length) { 13 $('.fancybox').fancybox({ 14 openEffect : 'elastic', 15 closeEffect : 'elastic', 16 helpers: { 17 overlay: { 18 locked: false, 19 } 20 } 21 }); 22 } 23 24 if($('.fancybox-thumb').length) { 25 $('.fancybox-thumb').fancybox({ 26 openEffect : 'elastic', 27 closeEffect : 'elastic', 28 // afterShow: function(){ 29 // $('body').addClass("fancy-open"); 30 // }, 31 // afterClose: function(){ 32 // $('body').removeClass("fancy-open"); 33 // }, 34 'beforeLoad': function(){ 35 disable_scroll(); 36 }, 37 'afterClose': function(){ 38 enable_scroll(); 39 }, 40 helpers : { 41 overlay: { 42 locked: false, 43 }, 44 thumbs: { 45 width : 60, 46 height : 60, 47 } 48 } 49 }); 50 51 // disable scrolling temporarily 52 var keys = [37, 38, 39, 40]; 53 54 function preventDefault(e) { 55 e = e || window.event; 56 if (e.preventDefault) e.preventDefault(); 57 e.returnValue = false; 58 } 59 60 function keydown(e) { 61 for (var i = keys.length; i--;) { 62 if (e.keyCode === keys[i]) { 63 preventDefault(e); 64 return; 65 } 66 } 67 } 68 69 function wheel(e) { 70 preventDefault(e); 71 } 72 73 function disable_scroll() { 74 if (window.addEventListener) { 75 window.addEventListener('DOMMouseScroll', wheel, false); 76 } 77 window.onmousewheel = document.onmousewheel = wheel; 78 document.onkeydown = keydown; 79 } 80 81 function enable_scroll() { 82 if (window.removeEventListener) { 83 window.removeEventListener('DOMMouseScroll', wheel, false); 84 } 85 window.onmousewheel = document.onmousewheel = document.onkeydown = null; 86 } 87 // 88 89 if( $(window).width() > 600 ) { 90 $.fancybox.helpers.thumbs.onUpdate = function( opts, obj ){ 91 if (this.list) { 92 var center = Math.floor($(window).width() * 0.5 - (obj.group.length / 2 * this.width + this.width * 0.5)); 93 this.list.css('left', center); 94 } 95 }; 96 } 97 } 98 } 99 100 SLZ.ajaxfunction = function() { 101 $('.sc_isotope_post').each(function(index, el) { 102 var id_class = $(this).attr('data-block-class'); 103 $(this).find('.grid-main .block-image a').attr('data-fancybox-group','group-'+id_class); 104 }); 105 106 /* ajax isotope post */ 107 $('.sc_isotope_post a.slz-btn.btn-loadmore').on('click', function() { 108 var uniq_id = $(this). parents('.sc_isotope_post').attr('data-block-class'); 109 110 var atts = jQuery.parseJSON( $(this).parents('.sc_isotope_post').find('.grid-clone .gallery_atts_more').attr('data-json') ); 111 112 $.fn.Form.ajax(['gallery', 'ajax_load_more_func'], [atts], function(res) { 113 $( uniq_id + ' .gallery_atts_more').remove(); 114 $(uniq_id + ' .grid-clone').append(res); 115 $(uniq_id).find('.grid-main').html( $(uniq_id).find('.grid-clone').html() ); 116 117 setTimeout(function() { 118 $(uniq_id).find('.grid-main').isotope('destroy').isotope({ 119 itemSelector: '.grid-item', 120 percentPosition: true, 121 masonry: { 122 columnWidth: '.grid-item' 123 } 124 }); 125 126 $(uniq_id + ' .grid-main .block-image a').attr('data-fancybox-group','group-'+uniq_id); 127 128 }, 100); 129 130 var data_pages = $(uniq_id + ' .grid-clone .gallery_atts_more').attr('data-pages'); 131 if( data_pages == '') { 132 $(uniq_id).find('a.btn-loadmore').remove(); 133 } 134 135 }); 136 }); 137 // ajax gallery grid 138 if($('.ajax-gallery-wrapper').length > 0){ 139 $('.ajax-gallery-wrapper a.slz-btn.btn-loadmore').on('click', function() { 140 var uniq_id = $(this). parents().attr('data-block-class'); 141 var atts = jQuery.parseJSON( $('.' + uniq_id + ' .ajax-gallery-atts').attr('data-json') ); 142 var sc_object = $(this). parents('.sc-gallery-grid').attr('data-name'); 143 $.fn.Form.ajax_sc([sc_object, 'ajax_load_more_func'], [atts], function(res) { 144 var res_arr = jQuery.parseJSON(res); 145 $('.' + uniq_id + ' .ajax-gallery').append(res_arr['grid']); 146 $('.' + uniq_id + ' .ajax-loadmore').html(res_arr['load_more']); 147 if( res_arr['load_more'] == '') { 148 $('.' + uniq_id + ' .btn-loadmore-wrapper').remove(); 149 } 150 }); 151 }); 152 } 153 154 } 155
156 /* appear btn on tab all */ 157 SLZ.tab_all_btn = function() { 158 $('.slz-isotope-nav ul.tab-filter li.tab-data-less div').on('click', function() { 159 var id = $(this).parents('.sc_isotope_post').attr('data-block-class'); 160 $(id + ' .slz-btn.btn-loadmore').addClass('hide'); 161 }); 162 $('.slz-isotope-nav ul.tab-filter li.tab-all-active div').on('click', function() { 163 var id = $(this).parents('.sc_isotope_post').attr('data-block-class'); 164 $(id + ' .slz-btn.btn-loadmore').removeClass('hide'); 165 }); 166 } 167 168 SLZ.isotopeFunction = function() { 169 // effect hover 170 //$('.slz-isotope-grid-2 .slz-block-gallery-01 .block-image').directionalHover(); 171 if($('.slz-isotope-grid-2').length) { 172 $('.slz-isotope-grid-2 > .grid-item').each( function() { 173 $(this).find('.slz-block-gallery-01').hoverdir({ 174 hoverDelay : 20, 175 }); 176 }); 177 } 178 setTimeout(function(){ 179 // mansory 1 180 if($('.slz-isotope-grid').length) { 181 $('.slz-isotope-grid').each(function(){ 182 var $grid = $(this).isotope({ 183 itemSelector: '.grid-item', 184 percentPosition: true, 185 masonry: { 186 columnWidth: '.grid-item' 187 } 188 }); 189 190 // filter functions 191 var filterFns = { 192 // show if number is greater than 50 193 numberGreaterThan50: function () { 194 var number = $(this).find('.number').text(); 195 return parseInt(number, 10) > 50; 196 }, 197 // show if name ends with -ium 198 ium: function () { 199 var name = $(this).find('.name').text(); 200 return name.match(/ium$/); 201 } 202 }; 203 // bind filter button click 204 $(this).parent().find('.tab-filter').on('click', '.tab', function () { 205 var filterValue = $(this).attr('data-filter'); 206 // use filterFn if matches value 207 filterValue = filterFns[filterValue] || filterValue; 208 $grid.isotope({filter: filterValue}); 209 }); 210 // change is-checked class on buttons 211 $(this).parent().find('.tab-filter').each(function (i, buttonGroup) { 212 var $buttonGroup = $(buttonGroup); 213 $buttonGroup.on('click', '.tab', function () { 214 $buttonGroup.find('.active').removeClass('active'); 215 $(this).addClass('active'); 216 }); 217 }); 218 }); 219 } 220 221 //masonry 2 222 if($('.slz-isotope-grid-2.grid-main').length) { 223 $('.slz-isotope-grid-2.grid-main').each(function(){ 224 var $grid = $(this).isotope({ 225 itemSelector: '.grid-item', 226 percentPosition: true, 227 masonry: { 228 columnWidth: '.grid-item' 229 } 230 }); 231 232 // filter functions 233 var filterFns = { 234 // show if number is greater than 50 235 numberGreaterThan50: function () { 236 var number = $(this).find('.number').text(); 237 return parseInt(number, 10) > 50; 238 }, 239 // show if name ends with -ium 240 ium: function () { 241 var name = $(this).find('.name').text(); 242 return name.match(/ium$/); 243 } 244 }; 245 // bind filter button click 246 $(this).parent().find('.tab-filter').on('click', '.tab', function () { 247 var filterValue = $(this).attr('data-filter'); 248 // use filterFn if matches value 249 filterValue = filterFns[filterValue] || filterValue; 250 $grid.isotope({filter: filterValue}); 251 }); 252 // change is-checked class on buttons 253 $(this).parent().find('.tab-filter').each(function (i, buttonGroup) { 254 var $buttonGroup = $(buttonGroup); 255 $buttonGroup.on('click', '.tab', function () { 256 $buttonGroup.find('.active').removeClass('active'); 257 $(this).addClass('active'); 258 }); 259 }); 260 261 }); 262 } 263 }, 500); 264 } 265 266 SLZ.gallery_tab = function() { 267 $('.gallery-list .grid-item').directionalHover(); 268 // get fancybox image related 269 $('.sc_gallery_tab .tab-pane').each(function(index, el) { 270 $(this).find('.block-image a').attr('data-fancybox-group','group-#'+$(this).attr('id')); 271 }); 272 273 // gallery style 01 274 $(".slz-gallery-tab-01").each(function(){
275 var carousel_item = parseInt($(this).attr('data-slidestoshow')); 276 var dots = $(this).attr('data-dots'); 277 var arrow = $(this).attr('data-arrows'); 278 var autoplay = $(this).attr('data-autoplay'); 279 var loop = $(this).attr('data-infinite'); 280 var speed = $(this).attr('data-speed'); 281 var animation = $(this).attr('data-animation'); 282 if ( dots == '1' ) { 283 dots = true; 284 }else{ 285 dots = false; 286 } 287 if ( arrow == '1' ) { 288 arrow = true; 289 }else{ 290 arrow = false; 291 } 292 if ( autoplay == '1' ) { 293 autoplay = true; 294 }else{ 295 autoplay = false; 296 } 297 if ( loop == '1' ) { 298 loop = true; 299 }else{ 300 loop = false; 301 } 302 if( speed == 0 || speed == '' || speed == undefined){ 303 speed = 500; 304 } 305 if ( animation == '1' ) { 306 animation = true; 307 }else{ 308 animation = false; 309 } 310 if (carousel_item == 1) { 311 $(this).find('.gallery-list').slick({ 312 slidesToShow: 1, 313 slidesToScroll: 1, 314 arrows: arrow, 315 dots: dots, 316 autoplay: autoplay, 317 infinite: loop, 318 speed: speed, 319 fade: animation, 320 prevArrow:'<button class="btn btn-prev"><i class="icons fa fa-angle-left"><i></button>', 321 nextArrow:'<button class="btn btn-next"><i class="icons fa fa-angle-right"><i></button>', 322 }); 323 } 324 if (carousel_item == 2) { 325 $(this).find('.gallery-list').slick({ 326 slidesToShow: 2, 327 slidesToScroll: 2, 328 arrows: arrow, 329 dots: dots, 330 autoplay: autoplay, 331 infinite: loop, 332 speed: speed, 333 fade: animation, 334 prevArrow:'<button class="btn btn-prev"><i class="icons fa fa-angle-left"><i></button>', 335 nextArrow:'<button class="btn btn-next"><i class="icons fa fa-angle-right"><i></button>', 336 responsive: [{ 337 breakpoint: 415, 338 settings: { 339 slidesToShow: 1, 340 slidesToScroll: 1, 341 } 342 }] 343 }); 344 } 345 if (carousel_item == 3) { 346 $(this).find('.gallery-list').slick({ 347 slidesToShow: 3, 348 slidesToScroll: 3, 349 arrows: arrow, 350 dots: dots, 351 autoplay: autoplay, 352 infinite: loop, 353 speed: speed, 354 fade: animation, 355 prevArrow:'<button class="btn btn-prev"><i class="icons fa fa-angle-left"><i></button>', 356 nextArrow:'<button class="btn btn-next"><i class="icons fa fa-angle-right"><i></button>', 357 responsive: [{ 358 breakpoint: 769, 359 settings: { 360 slidesToShow: 2, 361 slidesToScroll: 2, 362 } 363 }, { 364 breakpoint: 415, 365 settings: { 366 slidesToShow: 1, 367 slidesToScroll: 1, 368 } 369 }] 370 }); 371 } 372 if (carousel_item >= 4) { 373 $(this).find('.gallery-list').slick({ 374 slidesToShow: carousel_item, 375 slidesToScroll: carousel_item, 376 arrows: arrow, 377 dots: dots, 378 autoplay: autoplay, 379 infinite: loop, 380 speed: speed, 381 fade: animation, 382 prevArrow:'<button class="btn btn-prev"><i class="icons fa fa-angle-left"><i></button>', 383 nextArrow:'<button class="btn btn-next"><i class="icons fa fa-angle-right"><i></button>', 384 responsive: [{ 385 breakpoint: 1025, 386 settings: { 387 slidesToShow: 3, 388 slidesToScroll: 3, 389 } 390 }, { 391 breakpoint: 769, 392 settings: { 393 slidesToShow: 2, 394 slidesToScroll: 2, 395 } 396 }, { 397 breakpoint: 415, 398 settings: { 399 slidesToShow: 1, 400 slidesToScroll: 1 401 } 402 }] 403 }); 404 } 405 }); 406 407 // gallery style 02 408 if($('.sc_gallery_tab .slz-isotope-grid-2.grid-main').length) { 409 $('.sc_gallery_tab .slz-isotope-grid-2.grid-main').each(function(){ 410 var number = $(this).closest('.sc_gallery_tab').attr('data-number'); 411 var $grid = $(this).isotope({ 412 itemSelector: '.grid-item', 413 percentPosition: true, 414 filter: ':nth-child(-n+'+ number +')', 415 masonry: { 416 columnWidth: '.grid-item' 417 } 418 }); 419 420 // bind filter button click 421 $(this).parents('.sc_gallery_tab').find('.tab-filter .tab_item').on('shown.bs.tab', function (e) { 422 $(this).closest('.sc_gallery_tab').find('.tab-pane.active .btn-loadmore').attr('data-number', number).show(); 423 var $grid = $(this).parents('.sc_gallery_tab').find('.slz-isotope-grid-2.grid-main').isotope({ 424 itemSelector: '.grid-item', 425 percentPosition: true, 426 filter: ':nth-child(-n+'+ number +')', 427 masonry: { 428 columnWidth: '.grid-item' 429 } 430 }); 431 }); 432 433 // check hsow or hide load more button 434 var all_items = $(this).find('.grid-item').length; 435 if( number >= all_items ){ 436 $(this).parent().find('.btn-loadmore-wrapper').remove(); 437 } 438 }); 439 $('.sc_gallery_tab .tab-content .tab-pane .btn-loadmore').on('click', function(event) { 440 var number = $(this).closest('.sc_gallery_tab').attr('data-number'); 441 var current = $(this).attr('data-number'); 442 var all_items = $(this).closest('.tab-pane').find('.slz-isotope-grid-2.grid-main .grid-item').length; 443 var new_number = parseInt( number ) + parseInt( current ); 444 $(this).closest('.sc_gallery_tab').find('.slz-isotope-grid-2.grid-main').isotope({ 445 itemSelector: '.grid-item', 446 filter: ':nth-child(-n+'+ new_number +')', 447 percentPosition: true, 448 masonry: { 449 columnWidth: '.grid-item' 450 } 451 }); 452 $(this).attr('data-number', new_number); 453 if( new_number >= all_items ){ 454 $(this).hide(); 455 } 456 }); 457 } 458 } 459 460 SLZ.gallery_carousel = function() { 461 // effect hover 462 $('.sc_gallery_carousel .slz-carousel .item').directionalHover(); 463 464 $('.sc_gallery_carousel').each(function(index, el) { 465 var id_class = $(this).attr('data-item'); 466 $(this).find('.block-image a').attr('data-fancybox-group','group-.'+id_class); 467 $(this).find('.image-gallery-wrapper a').attr('data-fancybox-group','group-.'+id_class); 468 }); 469 470 // layout 1 471 $(".sc_gallery_carousel .slz-carousel").each( function(e, val) {
472 var carousel_item = parseInt($(this).attr('data-slidestoshow')); 473 var dots = $(this).attr('data-dotshow'); 474 var arrow = $(this).attr('data-arrowshow'); 475 var autoplay = $(this).attr('data-autoplay'); 476 var loop = $(this).attr('data-infinite'); 477 if ( dots == '1' ) { 478 dots = true; 479 }else{ 480 dots = false; 481 } 482 if ( arrow == '1' ) { 483 arrow = true; 484 }else{ 485 arrow = false; 486 } 487 if ( autoplay == '1' ) { 488 autoplay = true; 489 }else{ 490 autoplay = false; 491 } 492 if ( loop == '1' ) { 493 loop = true; 494 }else{ 495 loop = false; 496 } 497 498 if (carousel_item == 1) { 499 $(this).slick({ 500 infinite: loop, 501 autoplay: autoplay, 502 slidesToShow: 1, 503 slidesToScroll: 1, 504 dots: dots, 505 arrows: arrow, 506 appendArrows: $(this).parents('.slz-image-carousel'), 507 prevArrow: '<button class="btn btn-prev"><i class="icons fa"></i><span class="text">Previous</span></button>', 508 nextArrow: '<button class="btn btn-next"><span class="text">Next</span> <i class="icons fa"></i></button>' 509 }); 510 } 511 if (carousel_item == 2) { 512 $(this).slick({ 513 infinite: loop, 514 autoplay: autoplay, 515 slidesToShow: 2, 516 slidesToScroll: 2, 517 dots: dots, 518 arrows: arrow, 519 appendArrows: $(this).parents('.slz-image-carousel'), 520 prevArrow: '<button class="btn btn-prev"><i class="icons fa"></i><span class="text">Previous</span></button>', 521 nextArrow: '<button class="btn btn-next"><span class="text">Next</span> <i class="icons fa"></i></button>', 522 responsive: [{ 523 breakpoint: 415, 524 settings: { 525 slidesToShow: 1, 526 slidesToScroll: 1, 527 } 528 }] 529 }); 530 } 531 if (carousel_item == 3) { 532 $(this).slick({ 533 infinite: loop, 534 autoplay: autoplay, 535 slidesToShow: 3, 536 slidesToScroll: 3, 537 dots: dots, 538 arrows: arrow, 539 appendArrows: $(this).parents('.slz-image-carousel'), 540 prevArrow: '<button class="btn btn-prev"><i class="icons fa"></i><span class="text">Previous</span></button>', 541 nextArrow: '<button class="btn btn-next"><span class="text">Next</span> <i class="icons fa"></i></button>', 542 responsive: [{ 543 breakpoint: 769, 544 settings: { 545 slidesToShow: 2, 546 slidesToScroll: 2, 547 } 548 }, { 549 breakpoint: 415, 550 settings: { 551 slidesToShow: 1, 552 slidesToScroll: 1, 553 } 554 }] 555 }); 556 } 557 if (carousel_item >= 4) { 558 $(this).slick({ 559 infinite: loop, 560 autoplay: autoplay, 561 slidesToShow: carousel_item, 562 slidesToScroll: carousel_item, 563 dots: dots, 564 arrows: arrow, 565 appendArrows: $(this).parents('.slz-image-carousel'), 566 prevArrow: '<button class="btn btn-prev"><i class="icons fa"></i><span class="text">Previous</span></button>', 567 nextArrow: '<button class="btn btn-next"><span class="text">Next</span> <i class="icons fa"></i></button>', 568 responsive: [{ 569 breakpoint: 1025, 570 settings: { 571 slidesToShow: 3, 572 slidesToScroll: 3, 573 } 574 }, { 575 breakpoint: 769, 576 settings: { 577 slidesToShow: 2, 578 slidesToScroll: 2, 579 } 580 }, { 581 breakpoint: 415, 582 settings: { 583 slidesToShow: 1, 584 slidesToScroll: 1 585 } 586 }] 587 }); 588 } 589 }); 590 591 // layout 2 592 $(".sc_gallery_carousel .slz-carousel-mockup").each(function() { 593 var dots = $(this).find('.slz-slick-slider-mockup').attr('data-dotshow'); 594 var arrow = $(this).find('.slz-slick-slider-mockup').attr('data-arrowshow'); 595 var autoplay = $(this).find('.slz-slick-slider-mockup').attr('data-autoplay'); 596 var loop = $(this).find('.slz-slick-slider-mockup').attr('data-infinite'); 597 var sliderMock = $(this).find('.slz-slick-slider-mockup'); 598 if ( dots == '1' ) { 599 dots = true; 600 }else{ 601 dots = false; 602 } 603 if ( arrow == '1' ) { 604 arrow = true; 605 }else{ 606 arrow = false; 607 } 608 if ( autoplay == '1' ) { 609 autoplay = true; 610 }else{ 611 autoplay = false; 612 } 613 if ( loop == '1' ) { 614 loop = true; 615 }else{ 616 loop = false; 617 } 618 sliderMock.on('init', function(){ 619 $(window).load(function(){ 620 $(this).find(".slider-mockup").css("width", $(this).find('img.img-slider-item').width() + 30); 621 }); 622 $(window).resize(function(){ 623 $(this).find(".slider-mockup").css("width", $(this).find('img.img-slider-item').width() + 30); 624 }); 625 }); 626 sliderMock.slick({ 627 infinite: loop, 628 autoplay: autoplay, 629 dots: dots, 630 arrows: arrow, 631 slidesToShow: 3, 632 slidesToScroll: 1, 633 centerMode: true, 634 centerPadding: '160px', 635 focusOnSelect: true, 636 autoplaySpeed: 2000, 637 appendArrows: $(this).find('.slz-slick-slider-mockup').parents('.slz-image-carousel'), 638 prevArrow: '<button class="btn btn-prev"><i class="icons fa"></i><span class="text">Previous</span></button>', 639 nextArrow: '<button class="btn btn-next"><span class="text">Next</span> <i class="icons fa"></i></button>', 640 responsive: [ 641 { 642 breakpoint: 1025, 643 settings: { 644 centerPadding: '100px', 645 } 646 }, 647 { 648 breakpoint: 769, 649 settings: { 650 centerPadding: '0', 651 } 652 }, 653 { 654 breakpoint: 768, 655 settings: { 656 slidesToShow: 1, 657 slidesToScroll: 1, 658 centerPadding: '200px', 659 } 660 }, 661 { 662 breakpoint: 601, 663 settings: { 664 slidesToShow: 1, 665 slidesToScroll: 1, 666 centerPadding: '120px', 667 } 668 }, 669 { 670 breakpoint: 481, 671 settings: { 672 slidesToShow: 1, 673 slidesToScroll: 1, 674 centerPadding: '80px',
675 arrows: false, 676 } 677 }, 678 { 679 breakpoint: 415, 680 settings: { 681 slidesToShow: 1, 682 slidesToScroll: 1, 683 centerPadding: '30px', 684 arrows: false, 685 } 686 } 687 ] 688 }) 689 690 }); 691 692 // layout 3,4 693 $(".sc_gallery_carousel.slz-carousel-syncing").each(function() { 694 var carousel_item = parseInt($(this).find('.slider-nav').attr('data-slidestoshow')); 695 var dots = $(this).find('.slider-nav').attr('data-dotshow'); 696 var loop = $(this).find('.slider-nav').attr('data-infinite'); 697 var arrow = $(this).find('.slider-for').attr('data-arrowshow'); 698 var autoplay = $(this).find('.slider-for').attr('data-autoplay'); 699 var dots2 = $(this).find('.slider-for').attr('data-dotshow'); 700 if ( dots == '1' ) { 701 dots = true; 702 }else{ 703 dots = false; 704 } 705 if ( dots2 == '1' ) { 706 dots2 = true; 707 }else{ 708 dots2 = false; 709 } 710 if ( arrow == '1' ) { 711 arrow = true; 712 }else{ 713 arrow = false; 714 } 715 if ( autoplay == '1' ) { 716 autoplay = true; 717 }else{ 718 autoplay = false; 719 } 720 if ( loop == '1' ) { 721 loop = true; 722 }else{ 723 loop = false; 724 } 725 726 //$(this).find('.slider-for').slick( 'unslick' ); 727 $(this).find('.slider-for').slick({ 728 slidesToShow: 1, 729 slidesToScroll: 1, 730 arrows: arrow, 731 dots: dots2, 732 fade: true, 733 adaptiveHeight: true, 734 asNavFor: $(this).find('.slider-nav'), 735 prevArrow: '<button class="btn btn-prev"><i class="icons fa"></i><span class="text">Previous</span></button>', 736 nextArrow: '<button class="btn btn-next"><span class="text">Next</span> <i class="icons fa"></i></button>', 737 }); 738 739 //$(this).find('.slider-nav').slick( 'unslick' ); 740 $(this).find('.slider-nav').slick({ 741 slidesToShow: carousel_item, 742 slidesToScroll: 1, 743 asNavFor: $(this).find('.slider-for'), 744 focusOnSelect: true, 745 arrows: false, 746 infinite: loop, 747 centerMode: true, 748 centerPadding: '0px', 749 dots: dots, 750 responsive: [{ 751 breakpoint: 1025, 752 settings: { 753 slidesToShow: 4 754 } 755 }, { 756 breakpoint: 769, 757 settings: { 758 slidesToShow: 4 759 } 760 }, { 761 breakpoint: 601, 762 settings: { 763 slidesToShow: 4 764 } 765 }, { 766 breakpoint: 415, 767 settings: { 768 slidesToShow: 3 769 } 770 }, { 771 breakpoint: 381, 772 settings: { 773 slidesToShow: 2 774 } 775 }] 776 }); 777 }); 778 779 // layout 5 780 $('.sc_gallery_carousel.slz-carousel-centermode .carousel-overflow').each(function(){ 781 var dots = $(this).attr('data-dotshow'); 782 var loop = $(this).attr('data-infinite'); 783 var arrow = $(this).attr('data-arrowshow'); 784 var autoplay = $(this).attr('data-autoplay'); 785 if ( dots == '1' ) { 786 dots = true; 787 }else{ 788 dots = false; 789 } 790 if ( arrow == '1' ) { 791 arrow = true; 792 }else{ 793 arrow = false; 794 } 795 if ( autoplay == '1' ) { 796 autoplay = true; 797 }else{ 798 autoplay = false; 799 } 800 if ( loop == '1' ) { 801 loop = true; 802 }else{ 803 loop = false; 804 } 805 806 $(this).slick({ 807 infinite: loop, 808 autoplay: autoplay, 809 dots: dots, 810 arrows: arrow, 811 centerMode: true, 812 slidesToShow: 1, 813 centerPadding: '22%', 814 appendArrows: $(this).parents('.slz-image-carousel'), 815 prevArrow: '<button class="btn btn-prev"><i class="icons fa"></i><span class="text">Previous</span></button>', 816 nextArrow: '<button class="btn btn-next"><span class="text">Next</span><i class="icons fa"></i></button>', 817 responsive: [ 818 { 819 breakpoint: 1025, 820 settings: { 821 centerPadding: '15%', 822 } 823 }, 824 { 825 breakpoint: 769, 826 settings: { 827 centerPadding: '70px', 828 } 829 }, 830 { 831 breakpoint: 481, 832 settings: {
833 arrows: false, 834 centerPadding: '15px', 835 } 836 } 837 ] 838 }); 839 }); 840 } 841 842 SLZ.gallerycatrgories = function() { 843 $(".slz-gallery-feature").each(function() { 844 var object = $(this); 845 var slider = $(this).find('.service-slider-wrapper'); 846 if (slider.length) { 847 var slideItem = $(this).find('.slide-carousel'); 848 slideItem.slick({ 849 slidesToShow: 1, 850 slidesToScroll: 1, 851 autoplay: true, 852 autoplaySpeed:3000, 853 speed:1000, 854 }); 855 $(this).find('.slz-sv-item').each(function(index, el) { 856 slideItem.on('afterChange', function(event, slick, currentSlide, nextSlide) { 857 var data_count = parseInt( $(el).attr('data-count') ); 858 if (data_count === parseInt(currentSlide)) { 859 $('.slz-sv-item',object).removeClass('active'); 860 $(el).addClass('active'); 861 } 862 $(el).click(function() { 863 slideItem.slick('slickGoTo', index, false); 864 }); 865 }); 866 $(el).click(function() { 867 var clickplace = parseInt( $(this).attr('data-count') ); 868 $('.slz-sv-item',object).removeClass('active'); 869 $(this).addClass('active'); 870 slideItem.slick('slickGoTo', clickplace, false); 871 }); 872 }); 873 } 874 }); 875 } 876 877 SLZ.instagram_slider = function(){ 878 if($(".slz-carousel-photos .slz-carousel").length){ 879 $(".slz-carousel-photos .slz-carousel").each(function() { 880 var carousel_item = $(this).attr('data-slidesToShow'); 881 if( carousel_item == '' ){ 882 carousel_item = 4; 883 } 884 if (carousel_item == 1) { 885 $(this).slick({ 886 slidesToShow: carousel_item, 887 dots: true, 888 arrows: false, 889 }); 890 } 891 if (carousel_item == 2) { 892 $(this).slick({ 893 slidesToShow: carousel_item, 894 dots: true, 895 arrows: false, 896 responsive: [{ 897 breakpoint: 481, 898 settings: { 899 slidesToShow: 1, 900 slidesToScroll: 1, 901 } 902 }] 903 }); 904 } 905 if (carousel_item == 3) { 906 $(this).slick({ 907 slidesToShow: carousel_item, 908 dots: true, 909 arrows: false, 910 responsive: [{ 911 breakpoint: 769, 912 settings: { 913 slidesToShow: 2, 914 slidesToScroll: 2, 915 } 916 }, { 917 breakpoint: 481, 918 settings: { 919 slidesToShow: 1, 920 slidesToScroll: 1, 921 } 922 }] 923 }); 924 } 925 if (carousel_item >= 4) { 926 $(this).slick({ 927 slidesToShow: carousel_item, 928 dots: true, 929 arrows: false, 930 responsive: [{ 931 breakpoint: 1025, 932 settings: { 933 slidesToShow: 3, 934 slidesToScroll: 3, 935 } 936 }, { 937 breakpoint: 769, 938 settings: { 939 slidesToShow: 2, 940 slidesToScroll: 2, 941 } 942 }, { 943 breakpoint: 481, 944 settings: { 945 slidesToShow: 1, 946 slidesToScroll: 1, 947 } 948 }] 949 }); 950 } 951 }); 952 953 $('.slz-carousel-photos .slz-carousel .thumb').directionalHover({ 954 speed: 200 955 }); 956 957 $('.slz-instagram .item').directionalHover({ 958 speed: 200 959 }); 960 961 if($(".slz-instagram").hasClass("slz-image-carousel")){ 962 $('.slz-carousel-photos .slz-carousel .item').directionalHover(); 963 } 964 965 } 966 } 967 968 $(document).ready(function() { 969 SLZ.fancyboxFunction(); 970 SLZ.isotopeFunction(); 971 SLZ.ajaxfunction(); 972 SLZ.tab_all_btn(); 973 SLZ.gallery_carousel(); 974 SLZ.gallerycatrgories(); 975 SLZ.gallery_tab(); 976 SLZ.instagram_slider(); 977 });
978 979});
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.