1$('#personal-content__title').remove(); 2$.uiSlider = function () { 3 var $el = $('.uiSlider'); 4 if (!$el.length) return; 5 6 var $el = $('.uiSlider'); 7 if (!$el.length) return; 8 9 $el.each(function(){ 10 11 var $this = $(this), 12 $maxVal = $this.attr('data-maxVal'), 13 $minVal = $this.attr('data-minval'), 14 $dmax = $this.attr('data-max'), 15 $dmin = $this.attr('data-min'), 16 $thisMinCost = $this.closest('.ui').find('input.minCost'), 17 $thisMaxCost = $this.closest('.ui').find('input.maxCost'); 18 $this.slider({ 19 animate: 'slow', 20 range: true, 21 values: [$dmin, $dmax], 22 min: $minVal-1, 23 max: $maxVal, 24 stop: function(event, ui) { 25 26 if($('.ui-widget-header').attr("style")){ 27 var out=[]; 28 $('.ui-state-default').each(function(index, element) { 29 var style = $(this).attr("style"); 30 if(index==1){ 31 var re = /[0-9/]+/; 32 proc = style.match(re); 33 style = 100 - proc[0]; 34 right = 'right: '+style+'%;'; 35 } 36 else{ 37 left = style; 38 } 39 }); 40 out = right+' '+left; 41 console.log(left); 42 $('.bx_ui_slider_pricebar_VD').attr("style",out); 43 $('.bx_ui_slider_pricebar_V').attr("style",out); 44 $('.bx_ui_slider_handle.left').attr("style",left); 45 $('.bx_ui_slider_handle.right').attr("style",right); 46 } 47 48 49 $thisMinCost.val($this.slider('values',0)); 50 $thisMaxCost.val($this.slider('values',1)); 51 smartFilter.keyup(this); 52 var mins = $this.slider('values',0); 53 maxs = $this.slider('values',1) 54 $this.closest('.filter-price').find('.sel').html(mins + ' ÑÑб. -' + maxs+' ÑÑб.'); 55 $this.closest('.filter-price').find('.filter-title').addClass('visible'); 56 57 }, 58 slide: function(event, ui){ 59 $thisMinCost.val($this.slider('values',0)); 60 $thisMaxCost.val($this.slider('values',1)); 61 62 } 63 }); 64 $thisMinCost.change(function(){ 65 var value1=$thisMinCost.val(); 66 var value2=$thisMaxCost.val(); 67 if(parseInt(value1) > parseInt(value2)){ 68 value1 = value2; 69 $thisMinCost.val(value1); 70 } 71 $this.slider('values',0,value1); 72 $this.closest('.filter-price').find('.sel').html(value1 + ' ÑÑб. -' + value2+' ÑÑб.'); 73 $this.closest('.filter-price').find('.filter-title').addClass('visible'); 74 }); 75 $thisMaxCost.change(function(){ 76 var value1=$thisMinCost.val(); 77 var value2=$thisMaxCost.val(); 78 //if (value2 > $maxVal) { value2 = $maxVal; $thisMaxCost.val($maxVal)} 79 if(parseInt(value1) > parseInt(value2)){ 80 value2 = value1; 81 $thisMaxCost.val(value2); 82 } 83 $this.slider('values',1,value2); 84 $this.closest('.filter-price').find('.sel').html(value1 + ' ÑÑб. -' + value2+' ÑÑб.'); 85 $this.closest('.filter-price').find('.filter-title').addClass('visible'); 86 }); 87 88 89 }); 90 91 // ÑилÑÑÑаÑÐ¸Ñ Ð²Ð²Ð¾Ð´Ð° в Ð¿Ð¾Ð»Ñ 92 $('.valSl').keypress(function(event){ 93 var key, keyChar; 94 if(!event) var event = window.event; 95 96 if (event.keyCode) key = event.keyCode; 97 else if(event.which) key = event.which; 98 99 if(key==null || key==0 || key==8 || key==13 || key==9 || key==46 || key==37 || key==39 ) return true; 100 keyChar=String.fromCharCode(key); 101 102 if(!/\d/.test(keyChar)) return false;
103 104 }); 105}; 106(function($) { 107 //2 колонки 108 $('.column').each(function(){ 109 if($(this).height() > 344) { 110 $(this).addClass('column2') 111 } 112 }); 113 $('.column2').each(function(){ 114 if($(this).height() > 344) { 115 $(this).addClass('column3') 116 } 117 }); 118 //header mobile 119 $('.logo').clone().addClass('mob').prependTo($('header')) 120 //header catalog 121 $('.menuCatalog').clone().attr('id', 'mmenu').prependTo($('.bmenu')); 122 $('#mmenu .menu-catalog').each(function(){ 123 $(this).closest('.secindLvl').find('.title').replaceWith(function(index, oldHTML){ 124 $("<span>").html(oldHTML); 125 }); 126 }); 127 //ÐÐµÐ½Ñ 128 $("#mmenu").mmenu({ 129 extensions: [ "theme-white" ], 130 navbar: { 131 title: "", 132 offCanvas: false 133 } 134 }); 135 $('.menu .hmenu').after($('#mmenu')); 136 $('#mm-0').removeClass('mm-page').removeClass('mm-slideout').removeAttr('id'); 137 138 //filter mobile 139 if($('.filter').length){ 140 if($(window).width() <= 1000){ 141 142 $('.breadcrumbs').append('<ul class="filter sortMob"></ul><div class="filterMobile"><a href="#" class="filter--bt">ÑилÑÑÑ</a><div class="mmFilter"/></div>'); 143 $('.sortMob').append($('.filter-sort').clone()); 144 $('.mmFilter').append($('.filter--wrapper')); 145 $(".mmFilter").mmenu({ 146 extensions: ["position-right", "position-front"], 147 navbar: { 148 title: "ÑилÑÑÑ", 149 offCanvas: false, 150 } 151 }); 152 $('.mmFilter').prepend('<a class="close js-close-filter"><i/></a>'); 153 $('.mmFilter').wrap('<form name="_form" action="/catalog/" method="get" class="smartfilter"/>'); 154 } 155 $.uiSlider(); 156 $('.filter').append('<div class="bgFiler"/>'); 157 $.offsetBgFilter = function() { 158 var offsetTop = $('.filter').offset().top, 159 heightFilter = $('.filter').height(), 160 winTop = $(window).scrollTop(), 161 offsetBg = offsetTop + heightFilter - winTop; 162 $('.bgFiler').css('top', offsetBg); 163 } 164 $.offsetBgFilter(); 165 $(window).on('resize scroll', function(){ 166 $.offsetBgFilter(); 167 }); 168 }; 169 $(document).on('click', '.filter--bt', function(){ 170 $('.mmFilter').toggleClass('is-active'); 171 $('.bg').toggleClass('is-active'); 172 $('body').toggleClass('ov-hidd'); 173 $('html').toggleClass('ov-hidd'); 174 return false 175 }); 176 $(document).on('click', '.sortMob .filter-title', function(){ 177 $(this).closest('.filter-sort').toggleClass('active'); 178 return false 179 }); 180 $(document).on('click', '.js-close-filter', function(){ 181 $('.mmFilter').removeClass('is-active'); 182 $('.bg').removeClass('is-active'); 183 $('body').removeClass('ov-hidd'); 184 $('html').removeClass('ov-hidd'); 185 return false 186 }); 187 $(document).on('click', '.js-like', function(){ 188 $(this).toggleClass('is-active'); 189 }); 190 $(document).on('click', '.shake-agree', function(){ 191 $(this).parents('.shake-note').hide(); 192 }); 193}(jQuery)); 194 195$(document).on('click', '.backCity', function(){ 196 $(this).closest('.menuCity').removeClass('is-open'); 197 return false 198}); 199//$(function(){ 200// $('.filter--box').hover(function(){ 201// $('.bgFiler').addClass('hover'); 202// }, function() { 203// $('.bgFiler').removeClass('hover'); 204// }); 205//}); 206$(document).on('click', '.bx_filter .filter-title', function(){ 207 $.offsetBgFilter(); 208 $(this).closest('.filter--box').toggleClass('active').siblings('.filter--box').removeClass('active'); 209 // if( $(this).closest('.filter--box').hasClass('active')){ 210 // $('.bgFiler').addClass('hover'); 211 // }else { 212 // $('.bgFiler').removeClass('hover'); 213 // } 214 return false 215}); 216 217$(document).on('click', '.filter--box .button', function(event){ 218 var $this = $(this); 219 var $container = $this.closest('.filter--box'); 220 if ($container.hasClass('active')) { 221 $container.removeClass('active'); 222 } 223}); 224 225$(document).on('click', function(event){ 226 if( $(event.target).closest('.filter-hidd').length) 227 return; 228 $('.filter--box').removeClass('active'); 229 $('.bgFiler').removeClass('hover'); 230 event.stopPropagation(); 231}); 232//ÐаÑка ÑелеÑона
233$.masked = function () { 234 var $el = $('.phone-masked'); 235 $el.mask("+7(999)999-99-99", {autoclear: false}); 236} 237 238//validator 239$.Valid = function (el) { 240 241 var $el = el; 242 243 if (!$el.length) return; 244 var validator = $el.validate({ 245 rules: { 246 name: { 247 required: true 248 }, 249 surname: { 250 required: true 251 }, 252 password: { 253 required: true 254 }, 255 password1: { 256 required: true, 257 minlength: 6, 258 pwcheck: true 259 }, 260 password2: { 261 required: true, 262 minlength: 6, 263 equalTo: '[name="password1"]' 264 }, 265 tel: { 266 required: true, 267 checkMask: true 268 }, 269 telMail: { 270 required: true, 271 checkTelMail: true 272 }, 273 check: { 274 required: true 275 }, 276 size: { 277 required: true 278 }, 279 email: { 280 required: true, 281 email: true 282 }, 283 submitHandler: function (form) { 284// form.submit(); 285 } 286 } 287 }) 288 $.validator.addMethod("pwcheck", function(value) { 289 return /^[A-Za-z0-9\d=!\-@._*]*$/.test(value) 290 && /[a-z]/.test(value) 291 && /\d/.test(value) 292 }, "Incorrect Password!"); 293 $.validator.addMethod("checkMask", function(value) { 294 return /\+\d{1}\(\d{3}\)\d{3}-\d{2}-\d{2}/g.test(value); 295 }); 296 $.validator.addMethod("checkTelMail", function(value) { 297 return /\+[0-9]{1,4}[0-9]{1,10}|(.*)@(.*)\.[a-z]{2,5}/g.test(value); 298 }); 299}; 300 301//menu 302$(document).on('click', '.btMenu', function(){ 303 $(this).toggleClass('is-active'); 304 $('.bg').toggleClass('is-active'); 305 $('body').toggleClass('ov-hidd'); 306 $('html').toggleClass('ov-hidd'); 307 return false 308}); 309$(window).on('load', function(){ 310 $('.menu').css({ 311 "opacity" : "1" 312 }); 313 $('.basketBox').css({ 314 "opacity" : "1" 315 }); 316 $('.oneClickBox').css({ 317 "opacity" : "1" 318 }); 319}); 320 321 322//Basket 323$(document).on('click', '.btBasket', function(){ 324 $(this).toggleClass('is-active'); 325 $('.bg').toggleClass('is-active'); 326 $('body').toggleClass('ov-hidd'); 327 $('html').toggleClass('ov-hidd'); 328 return false 329}) 330$(document).on('click', '.js-click', function(){ 331 $(this).closest('.btBasket').removeClass('is-active'); 332 $('.sumBox').load('/inc/ajax/sum_base.php'); 333 $('.oneClickBox').addClass('is-active'); 334 return false 335}); 336$(document).on('click', '.js-basket', function(){ 337 $(this).closest('.btBasket').addClass('is-active'); 338 $('.oneClickBox').removeClass('is-active'); 339 return false 340}); 341$(document).on('click', '.js-close', function(){ 342 $('.btBasket').removeClass('is-active'); 343 $('.oneClickBox').removeClass('is-active'); 344 $('.btMenu').removeClass('is-active'); 345 $('.bg').removeClass('is-active'); 346 $('.menuCity').removeClass('is-open'); 347 $('body').removeClass('ov-hidd'); 348 $('html').removeClass('ov-hidd'); 349 return false 350}); 351$(document).on('click', '.bg', function(){ 352 $('.btBasket').removeClass('is-active'); 353 $('.oneClickBox').removeClass('is-active'); 354 $('.btMenu').removeClass('is-active'); 355 $('.bg').removeClass('is-active'); 356 $('.menuCity').removeClass('is-open'); 357 $('.mmFilter').removeClass('is-active'); 358 $('body').removeClass('ov-hidd'); 359 $('html').removeClass('ov-hidd'); 360}); 361$(document).on('click', '.js-openCity', function(){ 362 $('.menuCity').toggleClass('is-open'); 363 $.menuCityTop(); 364 return false 365}); 366$(document).on('click', '.tableBasket tr:not(.remove) .rem', function(){ 367 $(this).closest('tr').addClass('remove').find('td').last().prepend('<span class="removeText">ÑÐ¾Ð²Ð°Ñ Ñдален</span>'); 368 return false 369}); 370$(document).on('click', '.tableBasket tr.remove .rem', function(){ 371 $(this).closest('tr').removeClass('remove').find('.removeText').remove(); 372 return false 373}); 374$.menuCityTop = function(){ 375 var cityTop = $('.menu .city').offset().top; 376 $('.menuCity .citySearch').css('margin-top', cityTop + 'px') 377}; 378$.menuCityTop(); 379$(window).on('resize', function(){ 380 $.menuCityTop(); 381}) 382 383 384//Search 385$.searc = function(){ 386 var topbBg = $('.hhead').outerHeight(); 387 $('.main-block').append($('<div class="bgSearch"/>')) 388// $('.search .bgSearch').css('top', topbBg + 'px') 389 $(document).on('click', '.bt_search_open', function(event){ 390 $(this).next('.hidd').fadeToggle(); 391 $('.search .input-search').focus(); 392 $('.search').addClass('open'); 393 $('.bgSearch').addClass('active'); 394 event.stopPropagation(); 395 396 }); 397 $(document).on('keypress', '.search .input-search', function (){ 398 if ($(this).val()!='') $(this).closest('.search').addClass('active'); 399 }); 400 $(document).on('click', function(event){ 401 $('.search').removeClass('open'); 402 if( $(event.target).closest('.search').length) 403 return; 404 $('.search .hidd').fadeOut().closest('.search').removeClass('active'); 405 $('.bgSearch').removeClass('active'); 406 407 event.stopPropagation(); 408 409 }); 410 $(document).on('click', '.js-close-search', function(event){ 411 $(this).closest('.hidd').fadeToggle(); 412 $('.search').removeClass('open').removeClass('active'); 413 $('.bgSearch').removeClass('active'); 414 event.stopPropagation(); 415 }); 416}(); 417$.newsSlider = function(){ 418 var slidesPerView_var = 1; 419 if($('.page__news--slider-container .swiper-slide').length == 5) { 420 slidesPerView_var = 5; 421 } else if($('.page__news--slider-container .swiper-slide').length == 4){ 422 slidesPerView_var = 4; 423 } else if($('.page__news--slider-container .swiper-slide').length == 3){ 424 slidesPerView_var = 3; 425 } else if($('.page__news--slider-container .swiper-slide').length == 2){ 426 slidesPerView_var = 2; 427 } else { 428 //slidesPerView_var = 5; 429 } 430 431 $('.page__news--slider-container').each(function(index, value){ 432 var swiper = new Swiper(value, { 433 loop: $('.page__news--slider-container .swiper-slide').length > 5 ? true : false, 434 watchOverflow: true, 435 grabCursor: true, 436 slidesPerView: slidesPerView_var, 437 spaceBetween: 40, 438 //loop: true, 439 loopedSlides: 3, 440 speed: 1000, 441 parallax: true, 442 loopFillGroupWithBlank: true, 443 navigation: { 444 nextEl: '.page__news-swiper-button-next', 445 prevEl: '.page__news-swiper-button-prev', 446 }, 447 breakpoints: { 448 0: { 449 slidesPerView: 1, 450 spaceBetween: 20 451 }, 452 460: { 453 slidesPerView: 2, 454 spaceBetween: 20 455 }, 456 767: { 457 slidesPerView: 3, 458 spaceBetween: 30 459 }, 460 1000: { 461 slidesPerView: 4, 462 spaceBetween: 38 463 } 464 } 465 }); 466 467 }); 468}; 469$.catalogSlider = function(){ 470 $('.catalog--slider').each(function(index, value){ 471 var numberOfSlides = $(this).find('.swiper-slide').length; 472 var swiper = new Swiper(value, { 473 slidesPerView: 5, 474 loop: numberOfSlides <= 5 ? false : true, 475 speed: 1000, 476 parallax: true, 477 loopAdditionalSlides: 10, 478 navigation: { 479 nextEl: value.nextElementSibling.nextElementSibling, 480 prevEl: value.nextElementSibling, 481 }, 482 breakpoints: { 483 0: { 484 slidesPerView: 2, 485 slidesPerGroup: 2, 486 loop: numberOfSlides <= 2 ? false : true, 487 spaceBetween: 20 488 }, 489 480: { 490 slidesPerView: 3, 491 slidesPerGroup: 3, 492 loop: numberOfSlides <= 3 ? false : true, 493 spaceBetween: 30 494 }, 495 670: { 496 slidesPerView: 3, 497 slidesPerGroup: 3, 498 loop: numberOfSlides <= 3 ? false : true, 499 spaceBetween: 30 500 }, 501 1000: { 502 slidesPerView: 4, 503 slidesPerGroup: 4, 504 loop: numberOfSlides <= 4 ? false : true, 505 spaceBetween: 30 506 }, 507 1440: { 508 slidesPerView: 6, 509 slidesPerGroup: 6, 510 loop: numberOfSlides <= 6 ? false : true, 511 spaceBetween: 40 512 }, 513 1920: { 514 slidesPerView: 9, 515 slidesPerGroup: 9, 516 loop: numberOfSlides <= 9 ? false : true, 517 spaceBetween: 40 518 } 519 } 520 }); 521 522 }); 523}; 524var catalogContainer = document.querySelector('.main-block'); 525if (catalogContainer) { 526 var observer = new MutationObserver(function(mutations) { 527 mutations.forEach(function(mutation) { 528 if (mutation.addedNodes.length > 0) {
529 mutation.addedNodes.forEach(function(node) { 530 // ÐÑовеÑÑем, еÑÑÑ Ð»Ð¸ в добавленном Ñзле Ð½Ð°Ñ ÑÐ»Ð°Ð¹Ð´ÐµÑ 531 if ($(node).find('.catalog--slider').length > 0 || $(node).hasClass('catalog--slider')) { 532 try { 533 // УниÑÑожаем ÑÑаÑÑе ÑкземплÑÑÑ Swiper 534 $('.catalog--slider').each(function() { 535 if (this.swiper) { 536 this.swiper.destroy(true, true); 537 } 538 }); 539 // ÐниÑиализиÑÑем новÑе 540 $.catalogSlider(); 541 } catch (e) { 542 console.error("ÐÑибка пÑи пеÑеиниÑиализаÑии ÑлайдеÑа:", e); 543 } 544 } 545 }); 546 } 547 }); 548 }); 549 550 observer.observe(catalogContainer, { 551 childList: true, 552 subtree: true 553 }); 554} 555$.catalogSliderBig = function(){ 556 $('.catalog--slider-big').each(function(index, value){ 557 if ($(window).width() >= 1920) { 558 if ($(value).find($('.swiper-slide')).length > 7) { 559 var swiper = new Swiper(value, { 560 slidesPerView: 6, 561 spaceBetween: 40, 562 loop: true, 563 loopedSlides: 5, 564 speed: 1000, 565 parallax: true, 566 loopFillGroupWithBlank: true, 567 navigation: { 568 nextEl: value.nextElementSibling.nextElementSibling, 569 prevEl: value.nextElementSibling 570 }, 571 breakpoints: { 572 0: { 573 slidesPerView: 2, 574 spaceBetween: 20 575 }, 576 480: { 577 slidesPerView: 3, 578 spaceBetween: 30 579 }, 580 670: { 581 slidesPerView: 3, 582 spaceBetween: 10 583 }, 584 1000: { 585 slidesPerView: 4, 586 spaceBetween: 40 587 }, 588 1920: { 589 slidesPerView: 7, 590 spaceBetween: 40 591 } 592 } 593 }); 594 } else { 595 $(value).closest('.catalog--slider--wrapper').addClass('swiper-button--hide'); 596 } 597 } else if ($(window).width() < 1920) { 598 if ($(value).find($('.swiper-slide')).length > 4) { 599 var swiper = new Swiper(value, { 600 slidesPerView: 6, 601 spaceBetween: 40, 602 loop: true, 603 loopedSlides: 5, 604 speed: 1000, 605 parallax: true, 606 loopFillGroupWithBlank: true, 607 navigation: { 608 nextEl: value.nextElementSibling.nextElementSibling, 609 prevEl: value.nextElementSibling 610 }, 611 breakpoints: { 612 0: { 613 slidesPerView: 2, 614 spaceBetween: 20 615 }, 616 480: { 617 slidesPerView: 3, 618 spaceBetween: 30 619 }, 620 670: { 621 slidesPerView: 3, 622 spaceBetween: 10 623 }, 624 1000: { 625 slidesPerView: 4, 626 spaceBetween: 40 627 }, 628 1920: { 629 slidesPerView: 7, 630 spaceBetween: 40 631 } 632 } 633 }); 634 } else { 635 $(value).closest('.catalog--slider--wrapper').addClass('swiper-button--hide'); 636 } 637 } 638 }); 639}; 640$.mainSlider = function() { 641 // Params 642let mainSliderSelector = '.main-slider', 643 interleaveOffset = 0.5; 644 645 // Main Slider 646 let mainSliderOptions = { 647 loop: $('.main-slider .swiper-slide').length > 1 ? true : false, 648 speed: 1000, 649 autoplay: { 650 delay: 3000 651 }, 652 loopAdditionalSlides: 10, 653 watchOverflow: true, 654 grabCursor: true, 655 watchSlidesProgress: true, 656 pagination: { 657 el: '.swiper-pagination', 658 }, 659 /*autoHeight: true,*/ 660 navigation: { 661 nextEl: '.swiper-button-next', 662 prevEl: '.swiper-button-prev', 663 }, 664 on: { 665 init: function () { 666 this.autoplay.stop(); 667 }, 668 imagesReady: function () { 669 this.el.classList.remove('loading'); 670 this.autoplay.start(); 671 }, 672 slideChangeTransitionEnd: function () { 673 let swiper = this, 674 captions = swiper.el.querySelectorAll('.caption'); 675 for (let i = 0; i < captions.length; ++i) { 676 captions[i].classList.remove('show'); 677 } 678 swiper.slides[swiper.activeIndex].querySelector('.caption').classList.add('show'); 679 }, 680 progress: function () { 681 let swiper = this; 682 for (let i = 0; i < swiper.slides.length; i++) { 683 let slideProgress = swiper.slides[i].progress, 684 innerOffset = swiper.width * interleaveOffset, 685 innerTranslate = slideProgress * innerOffset; 686 687 swiper.slides[i].querySelector(".slide-bgimg").style.transform =
688 "translateX(" + innerTranslate + "px)"; 689 } 690 }, 691 touchStart: function () { 692 let swiper = this; 693 for (let i = 0; i < swiper.slides.length; i++) { 694 swiper.slides[i].style.transition = ""; 695 } 696 }, 697 setTransition: function (speed) { 698 let swiper = this; 699 for (let i = 0; i < swiper.slides.length; i++) { 700 swiper.slides[i].style.transition = speed + "ms"; 701 swiper.slides[i].querySelector(".slide-bgimg").style.transition = 702 speed + "ms"; 703 } 704 } 705 } 706 }; 707 let mainSlider = new Swiper(mainSliderSelector, mainSliderOptions); 708} 709 710$('[data-img]').each(function(){ 711 $(this).addClass('ainimated').prepend('<i class="bg-img"/>'); 712 var imgLink = $(this).data('img'); 713 $(this).find('.bg-img').css('background-image', 'url('+ imgLink +')'); 714}); 715$('.ainimated').parents('ul:not(.catalog)').each(function(){ 716 if($(this).find('li').length > 2){ 717 if(!$(this).hasClass('delay')){ 718 $(this).addClass('delay'); 719 $('li', this).each(function(i){ 720 $(this).find('.bg-img').css('transition-delay' , (i/10*2) + 's'); 721 722 }) 723 } 724 } 725}); 726var wow = new WOW( 727 { 728 boxClass: 'ainimated', 729 animateClass: 'on', 730 offset: 0, 731 mobile: true, 732 live: true, 733 scrollContainer: null 734 } 735); 736wow.init(); 737 738$.instaWidth = function(){ 739 var $this = $('.insta--list'), 740 width = $(window).width(), 741 widthEl = $this.find('li').innerWidth(), 742 sumVisible11 = width / widthEl, 743 sumVisible = Math.floor(width / widthEl); 744 $this.find('li').removeClass('hidd') 745 $this.find('li').slice(sumVisible).addClass('hidd'); 746}; 747$.instaWidth() 748$(window).on('resize', function(){ 749 $.instaWidth() 750}); 751//filter 752if($('.filter').length){ 753 $('.filter-title').append('<span class="sel"/>'); 754} 755// $(document).on('click', '.filter .rem', function(){ 756// $(this).closest('.filter--box').find('[type="checkbox"]', '[type="radio"]').prop('checked', false); 757// $(this).closest('.filter--box').find('.filter-title').removeClass('visible').removeClass('visibleSize'); 758// }); 759 760$(document).on('click', '.filter--ok', function(){ 761 var chek = $(this).closest('.filter-hidd').find('input:checked'); 762 $(this).closest('.filter--box').find('.sel').empty(); 763 chek.siblings('span').clone().addClass('btCheck').prependTo($(this).closest('.filter--box').find('.sel')); 764 if(chek.length ){ 765 if(chek.length > 1){ 766 $(this).closest('.filter--box').find('.filter-title').addClass('visible'); 767 $(this).closest('.filter--box').find('.filter-title').removeClass('visibleOne'); 768 }else { 769 $(this).closest('.filter--box').find('.filter-title').removeClass('visible'); 770 $(this).closest('.filter--box').find('.filter-title').addClass('visibleOne'); 771 } 772 } else { 773 $(this).closest('.filter--box').find('.filter-title').removeClass('visible').removeClass('visibleOne'); 774 } 775}); 776 777$(document).on('click', '.filter--ok-ui', function(){ 778 var priceFilterMin = $(this).closest('.filter-hidd').find('.minCost').val(), 779 priceFilterMax = $(this).closest('.filter-hidd').find('.maxCost').val(); 780 781 $(this).closest('.filter-price').find('.sel').html(priceFilterMin + '-' + priceFilterMax); 782 $(this).closest('.filter-price').find('.filter-title').addClass('visible'); 783}); 784if($('.goods').length){ 785 //$('.goods--info .description').prepend($('.goods--info .desc').clone()); 786 $('.goods--info-select .title-gray').append('<span class="inp"/>') 787 $(document).on('change', '.goods--info-select .checkbox', function(){ 788 var chek = $(this).closest('div').find('input:checked'); 789 $(this).closest('div').find('.inp').empty(); 790 chek.siblings('span').clone().addClass('btCheck').prependTo($(this).closest('div').find('.inp')); 791 792 if(chek.length ){ 793 $(this).closest('div').find('.title-gray').addClass('visible'); 794 } else { 795 $(this).closest('div').find('.title-gray').removeClass('visible'); 796 } 797 798 $(this).closest('div').find('.title-gray').removeClass('is-active'); 799 }); 800} 801$(document).on('touchstart', '.goods--info-select .title-gray', function(){ 802 $(this).toggleClass('is-active'); 803}) 804$.goodsSlider = function(){ 805 806 var galleryThumbs = new Swiper('.goods--slider .goods--slider--swiper--nav', { 807 direction: 'vertical', 808 navigation: { 809 nextEl: '.goods--slider .goods-next',
810 prevEl: '.goods--slider .goods-prev', 811 }, 812 spaceBetween: 15, 813 centeredSlides: false, 814 slidesPerView: 'auto', 815 touchRatio: 0.2, 816 slideToClickedSlide: true, 817 loop: false, 818 autoHeight: true, 819 }) 820 821 822 var galleryTop = new Swiper('.goods--slider .goods--slider--swiper', { 823 loop: false, 824 pagination: { 825 el: '.swiper-pagination', 826 dynamicBullets: true, 827 }, 828 thumbs: { 829 swiper: galleryThumbs, 830 }, 831 }); 832}; 833 834$.zoomBox = function(){ 835 $('.zoomBox').each(function(index, value){ 836 // $(this).mlens({ 837 // imgSrc: $(this).attr("data-big"), // path of the hi-res version of the image 838 // imgSrc2x: $(this).attr("data-big2x"), // path of the hi-res @2x version of the image 839 // lensShape: "square", 840 // lensSize: ["20%","30%"], 841 // borderSize: 0, 842 // borderRadius: 0, 843 // zoomLevel: 1, 844 // responsive: true, 845 // overlayAdapt: false 846 // }); 847 // $(this).zoom({url: $(this).attr("data-src")}); 848 849 var $this = $(this); 850 $this 851 .wrap('<span class="wrp" style="display:inline-block"></span>') 852 .css({"display":"block", "cursor":"crosshair"}); 853 $this.closest('.swiper-slide').zoom(); 854 }); 855} 856$(document).on('click', '.js-openBt', function(event){ 857 $(this).toggleClass('is-active').siblings('.hidd').slideToggle(); 858 return false 859}); 860//popup 861$(document).on('click', '[data-fancyajax]:not(.linkPage)', function(){ 862 var src = $(this).attr('href'), 863 bt = $(this); 864 $.fancybox.open({ 865 src: src, 866 type: 'inline', 867 opts: { 868 smallBtn: true, 869 btnTpl: { 870 smallBtn: '<button data-fancybox-close class="fancybox-close-small" title="{{CLOSE}}">' + 871 '<svg class="bt-close">' + 872 '<use xlink:href="#close"></use>' + 873 '</svg>' + 874 '</button>' 875 }, 876 lang: "ru", 877 i18n: { 878 ru: { 879 CLOSE: "ÐакÑÑÑÑ", 880 NEXT: "ÐпеÑÑд", 881 PREV: "Ðазад", 882 ERROR: "ÐапÑаÑиваемÑй конÑÐµÐ½Ñ Ð½Ðµ бÑл загÑÑжен <br/> ÐожалÑйÑÑа, попÑобÑйÑе позднее.", 883 PLAY_START: "ÐапÑÑÑиÑÑ ÑлайдÑоÑ", 884 PLAY_STOP: "ÐÑÑановиÑÑ ÑлайдÑоÑ", 885 FULL_SCREEN: "Ðа веÑÑ ÑкÑан", 886 THUMBS: "ÐиниаÑÑÑÑ", 887 DOWNLOAD: "СкаÑаÑÑ", 888 SHARE: "ÐоделиÑÑÑÑ", 889 ZOOM: "УвелиÑиÑÑ" 890 } 891 }, 892 infobar: false, 893 arrows: false, 894 zoom: false, 895 buttons: [ 896 "zoom", 897 "close" 898 ], 899 thumbs : { 900 autoStart : true 901 }, 902 clickContent: false, 903 youtube : { 904 controls : 0, 905 showinfo : 0 906 }, 907 afterShow: function() { 908 $('.js-nospace').each(function(){ 909 $.nospace(); 910 }); 911 $('.Valid').each(function(){ 912 $.Valid($(this)); 913 }); 914 $('select').each(function(){ 915 $('select:not(.ui-select)').select2({ 916 width: 'none', 917 searchInputPlaceholder: 'ÐведиÑе название гоÑода', 918 language: { 919 "noResults": function(){ 920 return "ÐиÑего не найдено"; 921 } 922 }, 923 }); 924 }); 925 $('.phone-masked').each(function(){ 926 $.masked(); 927 }); 928 929 930 }, 931 afterLoad: function(instance, slide) { 932 } 933 } 934 }); 935}); 936$('select:not(.selectMaps):not(.ui-select)').each(function(){ 937 $('select:not(.selectMaps):not(.ui-select)').select2({ 938 width: 'none' 939 }); 940}); 941$('select.selectMaps').each(function(){ 942 $('select.selectMaps:not(.ui-select)').select2({ 943 width: 'none', 944 minimumResultsForSearch: Infinity 945 }); 946}); 947 948//tabs 949$('.tabsContainerDevelory ul.tabs').on('click', 'li:not(.current)', function() { 950 $(this).addClass('current').siblings().removeClass('current') 951 .parents('.tabsContainerDevelory').find('.tabsBox').eq($(this).index()).fadeIn().siblings('.tabsBox').hide(); 952 var id = $(this).attr("rel"); 953 $("#ID_DELIVERY_ID_"+id).click(); 954 return false 955}); 956 957$(document).on('click', '.selectBoxCheck-open', function(){ 958 $(this).closest('.selectBoxCheck').toggleClass('open'); 959 return false 960}); 961 962$(document).on('change', '.checkboxImg input', function(){ 963 var nameShop = $(this).closest('.checkboxImg').find('.name').text(); 964 $(this).closest('.selectBoxCheck').find('.selectBoxCheck-open').html(nameShop); 965 $('.selectBoxCheck').removeClass('open'); 966}); 967$(document).on('click', '.js-question', function(){ 968 $(this).closest('.page__refund__question__box').siblings('li').find('.page__refund__question__hidd').removeClass('open').slide
968Up(); 969 $(this).siblings('.page__refund__question__hidd:not(.open)').slideDown().find('.close').addClass('open'); 970 return false 971}); 972$(document).on('click', '.page__refund__question__hidd .close', function(){ 973 $(this).closest('.page__refund__question__hidd').slideUp().find('.close').removeClass('open'); 974 return false 975}); 976if($('.castomWidth-list').length){ 977 $('html').addClass('castomWidthSelect'); 978} 979$.fancyImgOptions = ({}, $.fancyOptions, { 980 buttons: [ 981 "close" 982 ], 983 thumbs: { 984 autoStart: false, 985 }, 986 afterShow: function() { 987 $('.Valid').each(function(){ 988 $.Valid($(this)); 989 }); 990 }, 991 btnTpl: { 992 close:'<button data-fancybox-close class="fancybox-close-small" title="{{CLOSE}}" data-png="images/icons-close.png">' + 993 '<svg style="width: 1.125rem; height: 1.125rem; fill: #fff;">' + 994 '<use xlink:href="#close"></use>' + 995 '</svg>' + 996 '</button>', 997 arrowLeft: 998 '<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}">' + 999 '<div>' + 1000 '<svg style="transform: rotate(180deg); width: 1.63rem; height: 1.188rem; fill: #fff;">' + 1001 '<use xlink:href="#arrow-right-left"></use>' + 1002 '</svg>' + 1003 '</div>' + 1004 '</button>', 1005 1006 arrowRight: 1007 '<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}">' + 1008 '<div>' + 1009 '<svg style="width: 1.63rem; height: 1.188rem; fill: #fff;">' + 1010 '<use xlink:href="#arrow-right-left"></use>' + 1011 '</svg>' + 1012 '</div>' + 1013 '</button>' 1014 }, 1015 lang: "ru", 1016 i18n: { 1017 ru: { 1018 CLOSE: "ÐакÑÑÑÑ", 1019 NEXT: "ÐпеÑÑд", 1020 PREV: "Ðазад", 1021 ERROR: "ÐапÑаÑиваемÑй конÑÐµÐ½Ñ Ð½Ðµ бÑл загÑÑжен <br/> ÐожалÑйÑÑа, попÑобÑйÑе позднее.", 1022 PLAY_START: "ÐапÑÑÑиÑÑ ÑлайдÑоÑ", 1023 PLAY_STOP: "ÐÑÑановиÑÑ ÑлайдÑоÑ", 1024 FULL_SCREEN: "Ðа веÑÑ ÑкÑан", 1025 THUMBS: "ÐиниаÑÑÑÑ", 1026 DOWNLOAD: "СкаÑаÑÑ", 1027 SHARE: "ÐоделиÑÑÑÑ", 1028 ZOOM: "УвелиÑиÑÑ" 1029 } 1030 } 1031}); 1032$.fancyImages = function (el) { 1033 1034 var $el = el; 1035 1036 if (!$el.length) return; 1037 1038 1039 $el.fancybox($.fancyImgOptions); 1040 1041}; 1042$('.orderPage__form .item').last().after('<div class="order-composition"><a href="#" class="link">СоÑÑав заказа<a/><div class="hidd"/></div>'); 1043$('.order-composition .hidd').append($('.orderPage__tableBasket').clone().removeClass('ainimated')); 1044$(document).on('click', '.order-composition .link', function(){ 1045 $(this).closest('.order-composition').toggleClass('open'); 1046 return false 1047}); 1048$('.menuCatalog .firstLvl').hover(function(){ 1049 var $this = $(this); 1050 $this.addClass('hover') 1051 setTimeout(function() { 1052 $this.siblings('.firstLvl').removeClass('hover'); 1053 }, 150); 1054 }, 1055 function(){ 1056 var $this = $(this); 1057 setTimeout(function() { 1058 $this.removeClass('hover') 1059 }, 200); 1060}); 1061$(window).scroll(function () { 1062 if ($(this).scrollTop() > 100) { 1063 $('html').addClass('scroll'); 1064 } else { 1065 $('html').removeClass('scroll'); 1066 } 1067}); 1068 1069$(window).resize(function () { 1070 if ($(window).width() > 1000) { 1071 if ($('.size_error').length) { 1072 $('.size_error').appendTo('.cart_block'); 1073 } 1074 } else { 1075 if ($('.size_error').length) { 1076 $('.size_error').appendTo('.goods--info-select'); 1077 } 1078 } 1079}); 1080(function($) { 1081 1082 //ÑдалиÑÑ Ñ ÐºÐ¾ÑÐ·Ð¸Ð½Ñ 1083 $(document).on('click', '.tableBasket tr:not(.remove) .b-rem', function(e){ 1084 e.preventDefault(); 1085 BX.showWait(); 1086 BX.ajax.runAction('stratosfera:marccony.api.basket.delete', { 1087 data: { itemId: $(this).attr('data-rel') } 1088 }).then(function() { 1089 b_loaded(); 1090 $.ajax({ 1091 url: '/inc/ajax/basket.php', 1092 method: 'GET', 1093 dataType: 'html', 1094 success: function(res) { 1095 var a = $("div.sum_base", res); 1096 $("div.sum_base").html(a.html()); 1097 BX.closeWait(); 1098 } 1099 }); 1100 }); 1101 }); 1102 //воÑÑÑановиÑÑ ÑÐ¾Ð²Ð°Ñ Ð² коÑзине 1103 $(document).on('click', '.tableBasket tr.remove .b-rem', function(e){ 1104 BX.showWait(); 1105 e.preventDefault(); 1106 BX.ajax.runAction('stratosfera:marccony.api.basket.add', { 1107 data: { itemId: $(this).attr('rel'), quantity: 1 } 1108 }).then(function() { 1109 b_loaded(); 1110 $.ajax({ 1111 url: '/inc/ajax/basket.php', 1112 method: 'GET', 1113 dataType: 'html', 1114 success: function(res) { 1115 var a = $("div.sum_base", res); 1116 $("div.sum_base").html(a.html()); 1117 BX.closeWait(); 1118 } 1119 }); 1120 }); 1121 });
1122 //ÑдалиÑÑ Ñ ÐºÐ¾ÑÐ·Ð¸Ð½Ñ Ð² оÑоÑмлении 1123 $(document).on('click', '.tableBasket tr:not(.remove) .rems', function(){ 1124 $("div.sum_base").load("/inc/ajax/sum_base.php",{"del":$(this).attr('data-rel')}); 1125 $('#'+$(this).attr('data-rel')).attr("name"," "); 1126 //b_loaded(); 1127 submitForm(); 1128 return false 1129 }); 1130 //воÑÑÑановиÑÑ ÑÐ¾Ð²Ð°Ñ Ð² коÑзине в оÑоÑмлении 1131 $(document).on('click', '.tableBasket tr.remove .rems', function(){ 1132 $("div.sum_base").load("/inc/ajax/sum_base.php",{"add":$(this).attr('rel'),'num':1}); 1133 $('#'+$(this).attr('data-rel')).attr("name",$(this).attr('rel')); 1134 //b_loaded(); 1135 submitForm(); 1136 return false 1137 }); 1138 //пеÑедаем даннÑе в ÑилÑÑÑ 1139 $('.filter--box').each(function(){ 1140 var chek = $(this).find('input:checked'); 1141 chek.parents('.filter--box').find('.sel').empty(); 1142 chek.siblings('span').clone().addClass('btCheck').prependTo(chek.parents('.filter--box').find('.sel')); 1143 1144 if(chek.length ){ 1145 if(chek.length > 1){ 1146 chek.parents('.filter--box').find('.filter-title').addClass('visible'); 1147 chek.parents('.filter--box').find('.filter-title').removeClass('visibleOne'); 1148 chek.parents('.filter--box').find('.filter-titles').addClass('visible'); 1149 chek.parents('.filter--box').find('.filter-titles').removeClass('visibleOne') 1150 }else { 1151 chek.parents('.filter--box').find('.filter-title').removeClass('visible'); 1152 chek.parents('.filter--box').find('.filter-title').addClass('visibleOne'); 1153 chek.parents('.filter--box').find('.filter-titles').removeClass('visible'); 1154 chek.parents('.filter--box').find('.filter-titles').addClass('visibleOne'); 1155 } 1156 } else { 1157 chek.parents('.filter--box').find('.filter-title').removeClass('visible').removeClass('visibleOne'); 1158 } 1159 1160 if($(".maxCost").val() && $(".minCost").val()){ 1161 if($(".minCost").val()!=$(".minCost").attr("placeholder") || $(".maxCost").val()!=$(".maxCost").attr("placeholder")){ 1162 $('.filter-price').find('.sel').html($(".minCost").val() + ' ÑÑб. -' + $(".maxCost").val()+' ÑÑб.'); 1163 $('.filter-price').find('.filter-title').addClass('visible'); 1164 } 1165 } 1166 }); 1167 1168}(jQuery));
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.