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 doGetCaretPosition (ctrl) { | |
var CaretPos = 0; // IE Support | |
if (document.selection) { | |
ctrl.focus (); | |
var Sel = document.selection.createRange (); | |
Sel.moveStart ('character', -ctrl.value.length); | |
CaretPos = Sel.text.length; | |
} | |
// Firefox support | |
else if (ctrl.selectionStart || ctrl.selectionStart == '0') |
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
# Phone Mask | |
# маска телефонного номера для input | |
# IE9+ | |
# -------------------------------------------------------- | |
# cache | |
# phones — массив input-элементов, которым нужна маска | |
# setCaret — устанавливает курсор в нужную позицию | |
# getCaret — получает значение курсора | |
# mask — функция маскировки | |
# nums — массив из введенных чисел и _ (без семерки) |
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
# ScrollToAnchor | |
# IE9+, iOS | |
# -------------------------------------------------------- | |
# settings | |
# duration — продолжительность скроллинга | |
# timing — глобальная функция анимации | |
# cache | |
# @menu — пункт меню | |
# @end — до какой позиции скроллить | |
# scroll — функция прокрутки |
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
# Parallax | |
# IE9+, iOS* (без анимации) | |
# -------------------------------------------------------- | |
# cache | |
# parallax — блоки, которым необходимо применить параллакс | |
# settings | |
# start, stop — ограничительные позиции. Если экран находится за пределами этих позиции - параллакс к указанным элементам применяться не будет | |
# coefs — коэффициент скорости прокрутки, чем больше — тем быстрее прокрутка | |
# objStart — стартовые позиции параллакс-блоков | |
# bindEvents — по скроллу запускаем перерасчет позиции параллакс-блоков |
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="hex"> | |
<div class="hex-part"> | |
<div class="hex-cont"> | |
<p>content</p> | |
</div> | |
</div> | |
</div> |
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
# ScrollPage | |
# прокрутка страницы, как слайда | |
# IE9, iOS | |
# -------------------------------------------------------- | |
# cache | |
# page — прокручиваемые страницы (указывать всем главным блокам) | |
# settings | |
# duration — продолжительность прокрутки | |
# timing — временная функция | |
# bindEvents — когда вызывать прокрутку |
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
# Filter | |
# показывает блоки по выбранному фильтру | |
# IE9* (дергается анимация), iOS | |
# -------------------------------------------------------- | |
# cache | |
# filterCat — родительский блок со списками категорий | |
# filterBody — родительский блок с блоками | |
# settings | |
# anim — выбор функции анимации (из animShow и animHide) | |
# bindEvents — по клику на категорию из filterCat запускаем фильтр |
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
# Fix | |
# фиксирует элементы, когда они на верхней части экрана | |
# IE9+, iOS* (фиксируется только после отпуска пальца) | |
# -------------------------------------------------------- | |
# cache | |
# fixElems — фиксируемые элементы | |
# fixYPos — изначальные y-координаты fixElems | |
# fix — добавляет/удаляет класс "fixed" | |
# -------------------------------------------------------- |
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
# Preloader | |
# IE9+, iOS | |
# -------------------------------------------------------- | |
# cache | |
# preloader — "занавески" | |
# loader — вращающийся элемент | |
# remove — удаляет прелоадер с анимацией | |
# -------------------------------------------------------- | |
Preloader = do -> |
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
head | |
script(src="https://api-maps.yandex.ru/2.0-stable/?load=package.standard&lang=ru-RU" type="text/javascript") | |
script. | |
var myMap; | |
ymaps.ready(function(){ | |
// создание карты | |
myMap = new ymaps.Map("map", { | |
center: [55.76, 37.64], | |
zoom: 14 |
OlderNewer