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
// eslint-disable-next-line | |
console.log('value: ', value); |
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
Формула расчета | |
Все делается в два этапа: | |
1 - Делим исходную ширину на требуемую ширину; | |
2 - Получаем требуемую высоту, поделив исходную высоту на результат деления двух ширин (п.1). | |
Пример. Возьмем уже всем известные размеры изображений: 1024x768 и 800x600. Представим, что мы не знаем высоту второй картинки. По формуле получается следующее: 768/(1024/800) = 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
function swipeHandler () { | |
var initialPoint; | |
var finalPoint; | |
document.addEventListener('touchstart', function(event) { | |
if (typeof event !== 'undefined' && $(event.target).hasClass('slide-img') && $('body').hasClass('mobile')){ | |
initialPoint=event.changedTouches[0]; | |
} else { | |
return false; | |
} | |
}, false); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HTML5 видео в качестве заднего фона</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<video autoplay loop muted poster="video.jpg" class="bgvideo" id="bgvideo"> | |
<source src="video.mp4" type="video/mp4"></source> |
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
max-height: calc(~'100vh - 200px'); |
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
@for $i from 0 through 50 { | |
.mt-#{$i} { | |
margin-top: #{$i}px !important; | |
} | |
} | |
@for $i from 0 through 50 { | |
.mb-#{$i} { | |
margin-bottom: #{$i}px !important; | |
} | |
} |
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
.interval-generator(@index: 0) when (@index <= 50) { | |
// Paddings with step 5px | |
.pt@{index} { | |
padding-top: ~"@{index}px"; | |
} | |
.pb@{index} { | |
padding-bottom: ~"@{index}px"; | |
} | |
.pl@{index} { |
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
([\d]+\.*[\d]+) | |
из строки "розничная цена: 154.22 грн" достанет "154.22" | |
или из строки "розничная цена: 15422 грн" достанет "15422" |
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
<div class="move-wrap"> | |
<div id="follower"></div> | |
</div> | |
<style> | |
#follower{ | |
position : relative; | |
background-color : #000; | |
width:10px; | |
height:10px; /* Размеры движущегося объекта */ |
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
/* don't show the x for text inputs */ | |
::-ms-clear { | |
width : 0; | |
height: 0; | |
} | |
/* don't show the eye for password inputs */ | |
::-ms-reveal { | |
width : 0; | |
height: 0; |