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
// js | |
var a = $(".loader"), | |
d = a.find(".anim"); | |
d.fadeOut(), a.delay(300).fadeOut("slow"); | |
setTimeout(function(){ | |
$(".page").css("opacity",'1'); | |
}, 500); | |
// html | |
<div class="loader"> |
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
//js | |
$('.j-spoiler').each(function(){ | |
new Spoiler(this); | |
}); | |
Spoiler = function(container) { | |
this.container = $(container); | |
this.head = this.container.find('.j-spoiler-head'); | |
this.body = this.container.find('.j-spoiler-body'); | |
this.close = this.container.find('.j-spoiler-close'); | |
this.init(); |
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
if ($('.j-copy-btn').length > 0) { | |
var copyEmailBtn = document.querySelector('.j-copy-btn'); | |
copyEmailBtn.addEventListener('click', function(event) { | |
// Выборка ссылки с электронной почтой | |
var emailLink = document.querySelector('.j-copy-text'); | |
var range = document.createRange(); | |
range.selectNode(emailLink); | |
window.getSelection().addRange(range); | |
try { |
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
switch (prompt("Как погодка?")) { | |
case "дождь": | |
console.log("Не забудь зонт."); | |
break; | |
case "снег": | |
console.log("Блин, мы в России!"); | |
break; | |
case "солнечно": | |
console.log("Оденься полегче."); | |
case "облачно": |
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
* { | |
box-sizing: border-box; | |
} | |
.container { | |
width: 960px; | |
margin: 0 auto; | |
} | |
.row { | |
margin-bottom: 20px; |
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
/* grid */ | |
.row { | |
display: flex; | |
flex-flow: row wrap; | |
margin: 0 -10px; | |
margin-bottom: 10px; | |
} | |
.row:last-child { | |
margin-bottom: 0; | |
} |
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
<picture> | |
<source | |
srcset="<список URL c дескрипторами>" | |
[sizes="<ваши размеры в зависимости от раскладки>"] | |
[media="<медиавыражение>"] | |
[type="<mime/type>"] | |
> | |
<source ...> | |
... | |
<img src="image.jpg" alt="My image" |
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
/* не зумить страницу, если инпут в фокусе */ | |
@media(max-width:767px){ | |
input,select,textarea { | |
font-size:16px; | |
} | |
} | |
/* ховеры не нужны, включать только для десктопа */ | |
@media (min-width: 768px) { | |
.something: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
$(".j-anchor").click(function () { | |
var elementClick = $(this).attr("href") | |
var destination = $(elementClick).offset().top; | |
jQuery("html:not(:animated),body:not(:animated)").animate({scrollTop: destination - 100}, 800); | |
return false; | |
}); |
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
$('.j-price').each(function () { | |
var newPrice = XFormatPrice($(this).text()); | |
$(this).text(newPrice); | |
}); | |
function XFormatPrice(_number) | |
{ | |
var decimal=0; | |
var separator=' '; | |
var decpoint = '.'; |
OlderNewer