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
//start preloader | |
document.body.onload = function() { | |
setTimeout(function() { | |
$('.preloader').fadeOut('slow'); | |
}, 2000); | |
} | |
//end preloader |
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
//start scrolltop | |
$(window).scroll(function() { | |
if ($(this).scrollTop() > $(this).height()) { | |
$('.scrolltop').addClass('active'); | |
} else { | |
$('.scrolltop').removeClass('active'); | |
} | |
}); | |
$('.scrolltop').click(function() { | |
$('html, body').animate({scrollTop: 0}, 'slow', 'swing'); |
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
background: url('img/image.jpg') no-repeat center / cover; |
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
//start slowScroll | |
function slowScroll(id) { | |
if (!$(id).length) { | |
return | |
} | |
var offset = 0 | |
$('html, body').animate( | |
{ | |
scrollTop: $(id).offset().top - offset, | |
}, |
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).on('click', function(e) { | |
if (!$(e.target).closest('.setlang').length) { | |
// code | |
} | |
e.stopPropagation(); | |
}); |
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
$('.wrap__button').click(function() { | |
$('.wrap__selector').stop().slideToggle(); //Появление и исчезание блока | |
$('.wrap__field').focus(); //Устанока поля в фокус | |
}); | |
$(document).keyup(function(e) { //Отслеживание ESC | |
if(e.keyCode == 27) { | |
$('.wrap__selector').slideUp(); | |
} | |
}).click(function() { //клик на document, закрытие |
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
$('element').hover(function() { //Когда наводим курсор | |
ths = $(this); | |
lnk = ths.closest('element').find('element__hover-block'); | |
lnk.addClass('element__hover-block--hover'); | |
}, function() { //Обратная функция (Когда убираем курсор) | |
lnk.removeClass('element__hover-block--hover'); | |
}); |
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
$('.item').each(function() { //замена во всех item | |
var ths = $(this); | |
ths.html(ths.html().replace('O', '<span>O</span>')); //заменяем в item букву О на О в span | |
}); |
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
.video { | |
position: relative; | |
padding-bottom: 56.25%; | |
padding-top: 25px; | |
height: 0; | |
} | |
.video iframe { | |
border: none; | |
position: absolute; |
OlderNewer