This file contains 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 elem = document.getElementById('elem'); | |
var tween = new Tween({ | |
easing: 'easeInOutCubic', | |
step: function(pos) { | |
// перемещаемся от 100px до 300px | |
elem.style.left = (100 + 200 * step) + 'px'; | |
}, | |
complete: function() { | |
console.log('animation complete'); | |
} |
This file contains 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
// простая обётка, которая выполняет код в окружении ядра Zen Coding | |
// проедоставляет функции require (импорт модулей) и _ (библиотека underscore.js) | |
zen_coding.exec(function(require, _) { | |
var rePrefix = /\bb\-/g; | |
/** | |
* Рекурсивная функция, которая удаляет префикс b- у элемента и его потомков | |
* @param {AbbreviationNode} node | |
*/ | |
function trimPrefix(node) { |
This file contains 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 StepModel = Backbone.Model.extend({ | |
// шаблон для шага по умолчанию | |
template: 'steps/defaultTemplate', | |
initialize: function(data) { | |
// инициализруешь модель | |
// ... | |
// инициализация вьюхи | |
this.view = templates.render(data.template || this.template); |
This file contains 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
.button { | |
position: relative; | |
display: inline-block; | |
padding: 0 1em; | |
line-height: 2; | |
border-bottom: 1px solid #e6ad00; | |
border-top-left-radius: 5px; | |
border-bottom-left-radius: 5px; | |
This file contains 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
# right-click on Zen Coding.tmbundle, Show Package Contents, open Support/zen_editor.py and change line 170 to this: | |
doc_type = re.findall(r'\bhtml|css|xml|haml|scss\b', scope)[-1] | |
if doc_type == 'scss': | |
doc_type = 'css' |
This file contains 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
// Forcing Opera full page reflow/repaint to fix page draw bugs | |
function forceOperaRepaint() { | |
if (window.opera) { | |
var bs = document.body.style; | |
bs.position = 'relative'; | |
setTimeout(function() { | |
bs.position = 'static'; | |
}, 1); | |
} | |
} |