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
// добавление элементу класс "foo" | |
el.classList.add("foo"); | |
// удаление класса "bar" | |
el.classList.remove("bar"); | |
// переключение класса "foo" | |
el.classList.toggle("foo"); | |
// возвращает "true" если у класса есть класс "foo", в противном случае "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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title></title> | |
<style> | |
input { | |
width: 300px; | |
height: 30px; | |
font-size: 16px; | |
} |
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
//JavaScript | |
var widthOfElement = document.querySelector("#element-id").offsetWidth; | |
//jQuery | |
var widthOfElement = $("#element-id").outerWidth(); |
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 getProductId = function () { | |
var searchElems = {}; | |
if(location.search) { | |
var pair = (location.search.substr(1)).split('&'); | |
for (var i = pair.length - 1; i >= 0; i--) { | |
var param = pair[i].split('='); | |
searchElems[param[0]] = param[1]; | |
}; | |
return searchElems.product_id; //Получаем нужный параметр через точку | |
} |
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($){ | |
function equalizeHeights(selector) { | |
var heights = new Array(); | |
// Loop to get all element heights | |
$(selector).each(function() { | |
// Need to let sizes be whatever they want so no overflow on resize | |
$(this).css('height', 'auto'); |
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
.test:not(.test-1):not(.test-2):not(.test-3) { | |
color: red; | |
} |
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
Надо добавить удаленную ветку, чтобы она синхронизировалась через pull/push. | |
Сначала надо создать удаленную ветку: | |
git push origin origin:refs/heads/new_branch_name | |
Стянуть ее | |
git pull origin | |
Посмотреть появилась ли в списке удаленных веток: | |
git branch -r |
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) ⌄ | |
3) ︽ | |
4) ︾ | |
5) ︿ | |
6) ﹀ | |
7) 》 | |
8) 《 | |
9) ⬂ ⬃ ⬄ ⬅ ⬆ ⬇ ⬈ ⬉ ⬊ ⬋ ⬌ ⬍ ⬎ ⬏ ⬐ ⬑ | |
10) ❬ ❭ ❮ ❯ ❰ ❱ |
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 todoModel = (function () { | |
var _data = []; | |
function _addItem(name, duedate, description, completed) { | |
_data.push({ | |
id: getCurrentId(), | |
name: name, | |
duedate: duedate, | |
description: description, |
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
.element { | |
width: calc( 100% - 50px ); | |
} |