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 () { | |
jQuery('#top_menu li a').on('click', function(){ | |
var item = $(this).parent().attr('class'), | |
tar = $(this).attr('data'); | |
$("html, body").animate({ scrollTop: jQuery(tar).offset().top }, 1000); | |
}); | |
})() |
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
<?php | |
function sozdat_slag($stroka) { | |
$rus=array('А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П','Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я','а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п','р','с','т','у','ф','х','ц','ч','ш','щ','ъ','ы','ь','э','ю','я',' '); | |
$lat=array('a','b','v','g','d','e','e','gh','z','i','y','k','l','m','n','o','p','r','s','t','u','f','h','c','ch','sh','sch','y','y','y','e','yu','ya','a','b','v','g','d','e','e','gh','z','i','y','k','l','m','n','o','p','r','s','t','u','f','h','c','ch','sh','sch','y','y','y','e','yu','ya',' '); | |
$stroka = str_replace($rus, $lat, $stroka); // перевеодим на английский | |
$stroka = str_replace('-', '', $stroka); // удаляем все исходные "-" | |
$slag = preg_replace('/[^A-Za-z0-9-]+/', '-', $stroka); // заменяет все символы и пробелы на "-" |
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
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen | |
and (min-width : 321px) { |
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
// СВОЙСТВА И АТРИБУТЫ: prop and attr | |
// ======================================= | |
// PROP - для disabled | |
// правильно | |
$("input").prop('disabled', true); | |
$("input").prop('disabled', 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
/* | |
* запрещаем вводить цифры | |
* http://learn.javascript.ru/keyboard-events | |
*/ | |
// keydown event | |
e = (e) ? e : window.event; | |
var charCode = (e.which) ? e.which : e.keyCode; | |
// если от 0 до 9 |
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
/* | |
* break | |
* | |
* СИНТАКСИС: | |
* break [label] | |
* label - дает возможность прервать выполнение сразу нескольких уровней | |
*/ | |
// пример 1 |
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 for="year">Год</label> | |
<select name="year" id="year"></select> | |
<label for="month">Месяц</label> | |
<select name="month" id="month"> | |
<option value = "1">01</option> | |
<option value = "2">02</option> | |
<option value = "3">03</option> | |
<option value = "4">04</option> |
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
/* | |
* HANDLEBARS | |
*/ | |
// -------------------------------------------------------------------------------------- | |
// -------------------------------------------------------------------------------------- | |
// 1) ПРИМЕР ИСПОЛЬЗОВАНИЯ | |
// html | |
<script id="template" type="text/x-handlebars-template"> | |
<ul class="b10"> |
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
/* | |
* Underscore | |
* Parse object to array | |
*/ | |
_(obj).each(function(elem, key){ | |
// console.log(elem); | |
// console.log(key); | |
obj[key] = _(elem).values(); |