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
li { | |
width: 200px; | |
min-height: 250px; | |
border: 1px solid #000; | |
display: -moz-inline-stack; | |
display: inline-block; | |
vertical-align: top; | |
margin: 5px; | |
zoom: 1; | |
*display: inline; |
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
/* | |
* JQUERY PERFORMANCE | |
*/ | |
// 1) Don't forget to use context | |
var arms = $('div.robotarm', '#container'); | |
// вместо | |
var arms = $('#container').find('div.robotarm'); | |
// хуже всего: |
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
// Определение версии Internet Explorer (IE) в JavaScript | |
// Источник: http://tanalin.com/articles/ie-version-js/ | |
if (document.all && !document.querySelector) { | |
alert('IE7 или ниже'); | |
} | |
if (document.all && document.querySelector && !document.addEventListener) { | |
alert('IE8'); | |
} |
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
/* | |
* STRING IN JAVASCRIPT | |
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String | |
*/ | |
// Строки в JavaScript нельзя изменять. Можно прочитать символ, но нельзя заменить его. Как только строка создана — она такая навсегда. | |
// =================================================== | |
// =================================================== |
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
// ТЕОРИЯ | |
var pattern = "^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$" - тип "string" | |
var re = new RegExp(pattern); - это уже regex | |
// ССЫЛКИ | |
// готовые регулярки | |
Gskinner.com/RegExr/ | |
Regexlib.com | |
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
<!-- | |
Wordpress Date | |
http://codex.wordpress.org/Formatting_Date_and_Time | |
Для вывода даты публикации можно использовать две функции the_date() и the_time(). | |
Первая у меня почему-то глючила, так что я предпочитаю вторую. | |
Число | |
d 01–31 | |
j 1–31 |
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
// typeof | |
// Знает: | |
// 1) number | |
// 2) string | |
// 3) boolean | |
// 4) undefined | |
// 5) object | |
// 6) function | |
// Numbers |
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
// map, each | |
// ------------------------------------------------------------------------------------- | |
// map возвращает новый объект, а each - исходный | |
// отсюда следуюет, что метод each можно включать в цепочку вызова, а метод map - нельзя | |
// ------------------------------------------------------------------------------------- | |
// Map позволяет создать новый объект с изменёнными данными (на основе прежних). | |
// Each позволяет просто пройтись по объекту. | |
// .each() |
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
$("<img />", { | |
"src":"not/an/image.png", | |
"alt":"Такого изображения не существует" | |
}).appendTo("body"); |