Skip to content

Instantly share code, notes, and snippets.

@r-isayev-parc
Created July 3, 2012 10:47
Show Gist options
  • Save r-isayev-parc/3038998 to your computer and use it in GitHub Desktop.
Save r-isayev-parc/3038998 to your computer and use it in GitHub Desktop.
Оптимизация создания DOM элементов
loadingPageDocuments: function(customCount) {
var loader = $('<li class="b-load"><div class="b-borders"></div></li>'),
count = customCount || this.perPage,
container = $('#relations_page');
for (var i = 0; i < count; i++) {
container.append(loader.clone());
}
},
loadingPageDocuments: function(customCount) {
var loaderTpl = '<li class="b-load"><div class="b-borders"></div></li>',
count = customCount || this.perPage,
container = $('#relations_page'),
loaders = '';
for (var i = 0; i < count; i++) {
loaders += loaderTpl;
}
container.append(loaders);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment