This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const query = window.matchMedia('(min-width: 1200px)'); | |
query.onchange = (evt) => { | |
if(query.matches) { | |
} | |
}; | |
query.onchange(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gsap.registerPlugin(ScrollTrigger, ScrollSmoother, ScrollToPlugin); | |
// Sticky menu | |
function stickyMenuFunc() { | |
const sidebarElement = document.querySelector('.list-anchor'); | |
const sectionSidebar = '.section__sidebar'; | |
if (sidebarElement) { | |
gsap.to(sidebarElement, { | |
scrollTrigger: { | |
trigger: sidebarElement, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('.row').forEach((currentRow,index,rows)=>{ | |
currentRow.addEventListener('click',()=>{ | |
rows.forEach((row)=> row.classList.remove('active')); | |
currentRow.classList.add('active'); | |
}) | |
}) | |
<table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('.js-collapse').forEach(function(accordion) { | |
accordion.addEventListener('click', function(event) { | |
//event.preventDefault(); | |
let subAccordion = accordion.querySelector('.js-collapse-target'); | |
let clickTarget = event.target; | |
if( clickTarget.closest('.js-collapse-toggle') ) { | |
accordion.classList.toggle('open'); | |
setTimeout(function() { | |
if (subAccordion.style.maxHeight) { | |
subAccordion.style.maxHeight = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var $carousel = $('.carousel'); | |
$carousel.each(function() { | |
var swiper = new Swiper(this, { | |
spaceBetween: 30, | |
freeMode: true, | |
centeredSlides: false, | |
slidesPerView: 'auto', | |
touchRatio: 0.2, | |
slideToClickedSlide: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
function tab(trigger, item) { | |
// $(item).hide() | |
$(trigger).click(function(event) { | |
event.stopPropagation(); | |
$(item).not($(this).next()).slideUp(250); | |
$(this).next().slideToggle(250); | |
return false; | |
}) | |
$('html').click(function(event) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(window).scroll(function() { | |
// проверка на докрутку до определенного элемента | |
var scroll_picca =jQuery('.scroll_picca').offset().top; | |
console.log(scroll_picca) ;// выводим в консоль смещение элемента пицца | |
//если мы докрутили до нужного элемента | |
if (jQuery(this).scrollTop() > scroll_picca) { | |
// создаем эффекты и анимацию | |
jQuery(".bottom_float_menu").show(); | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// mutation | |
var observeObject = function () { | |
var _class = { | |
init: function (selector, callback) { | |
var element = document.querySelector(selector); | |
try { | |
var observer = new MutationObserver(function (mutations) { | |
mutations.forEach(function (mutation) { | |
callback(mutation.target, mutation.attributeName, mutation.oldValue); |
NewerOlder