This file contains hidden or 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(function($){ | |
$(document).mouseup(function (e){ // событие клика по веб-документу (or .on(touchstart click)) | |
var div = $("#popup"); // тут указываем ID элемента | |
if (!div.is(e.target) // если клик был не по нашему блоку | |
&& div.has(e.target).length === 0) { // и не по его дочерним элементам | |
div.hide(); // скрываем его | |
} | |
}); | |
}); |
This file contains hidden or 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).mouseup(function (e) { | |
let el = $(".leftmenu"); | |
if (el.has(e.target).length === 0){ | |
el.removeClass('active'); | |
} | |
}); |
This file contains hidden or 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
/* ANIMATE NUMBERS */ | |
var isResizeble = false; | |
function animateNumb() { | |
isResizeble = true; | |
$('.benefits-count').each(function() { | |
$(this).prop('counter',0).animate({ | |
counter:$(this).data('count') | |
},{ | |
duration: 2000, |
This file contains hidden or 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
var handler = function() { | |
}; // end handler | |
$(window).bind('load', handler); | |
$(window).bind('resize', handler); |
This file contains hidden or 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
// Скролл к элементу | |
$(".menu").on("click","a.scroll", function (e) { | |
e.preventDefault(); | |
var id = $(this).attr('href'), | |
top = $(id).offset().top; | |
$('body,html').animate({scrollTop: top}, 600); | |
}); |
This file contains hidden or 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
// скрытие placeholder | |
$('input, textarea').on('focus', function () { | |
var $this = $(this); | |
var placehold = $this.attr('placeholder'); | |
$this.attr('data-placeholder', placehold); | |
$this.attr('placeholder', ''); | |
// $this.data($this, 'placeholder', placehold); | |
}); | |
$('input, textarea').on('blur', function () { | |
var $this = $(this); |
This file contains hidden or 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
// HTML | |
<label> | |
<input class="checkbox" type="checkbox" name="checkbox-test"> | |
<span class="checkbox-custom"></span> | |
<span class="label">Lorem ipsum dolor</span> | |
</label> | |
// CSS | |
.checkbox { |
This file contains hidden or 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
JS: | |
$(".accordeon dd").hide().prev().click(function() { | |
$(this).parents(".accordeon").find("dd").not(this).slideUp().prev().removeClass("active"); | |
$(this).next().not(":visible").slideDown().prev().addClass("active"); | |
}); | |
CSS: | |
.accordeon .active { color: red } | |
HTML: |
This file contains hidden or 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
HTML: | |
<div class="tabs-wrapper"> | |
<div class="tab_header"> | |
<span class="tab">Вкладка 1</span> | |
<span class="tab">Вкладка 2</span> | |
<span class="tab">Вкладка 3</span> | |
</div> | |
<div class="tab_content"> | |
<div class="tab_item">Содержимое 1</div> | |
<div class="tab_item">Содержимое 2</div> |