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
$('a[href^="#"]').on("click", function(){ | |
var the_id = $(this).attr("href"); | |
$('html, body').animate({ | |
scrollTop:$(the_id).offset().top | |
}, 'slow'); | |
return false; | |
}); |
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
<!-- HTML --> | |
<form> | |
<!-- Hidden Required Fields --> | |
<input type="hidden" name="project_name" value="Site Name"> | |
<input type="hidden" name="admin_email" value="[email protected]"> | |
<input type="hidden" name="form_subject" value="Form Subject"> | |
<!-- END Hidden Required Fields --> | |
<input type="text" name="Name" placeholder="You name..." required><br> |
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
// jQuery addClass on scroll | |
var section1 = $('.css-class').offset().top; | |
var section2 = $('.css-class-2').offset().top; | |
$(window).scroll(function(){ | |
//section-1 | |
if( $(window).scrollTop() > section1 ) { | |
$('.css-class').addClass('active'); //добавить класс, когда проскроллил элемент. |
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
This is my Atom settings. |
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
//- Declaration | |
mixin pet(name) | |
li.pet= name | |
//- Use | |
ul | |
+pet('cat') |
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
" auto reload .vimrc when changed, this avoids reopening vim | |
autocmd! bufwritepost .vimrc source % | |
set nocompatible " be iMproved, required | |
filetype on " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins |
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
function (number) { | |
var cases = [2, 0, 1, 1, 1, 2]; | |
var titles = ['год', 'года', 'лет']; | |
return number + " " + titles[(number % 100 > 4 && number % 100 < 20) ? 2 : cases[(number % 10 < 5) ? number % 10 : 5]]; | |
} |
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
function ellipsizeTextBox(id, height) { | |
var el = document.getElementById(id); | |
el.style.maxHeight = height; | |
var wordArray = el.innerHTML.split(' '); | |
if (height) { | |
el.style.maxHeight = height; | |
} | |
while(el.scrollHeight > el.offsetHeight) { | |
wordArray.pop(); | |
el.innerHTML = wordArray.join(' ') + '...'; |
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
/** | |
* ENG | |
* Makes element fixed only for the mobile version of site (until 768px) | |
* @constructor | |
* @param {string} sTarget - target css-class for the element, which becomes fixed (.j-sticky-bar) | |
* @param {string} sFixedClass - the name of the css-class you want to add to the sTarget element (j-fixed) | |
* @param {sContent} sFixedClass - when sTarget becomes fixed, sContent element gets additional padding-top (body) | |
*/ | |
/** |
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
const formatData = { | |
// Граммы переводит в килограммы | |
weight : function (weight) { | |
weight = parseFloat(weight); | |
let dimension = ''; | |
if (weight < 1000) { | |
dimension = ' г'; | |
} else { | |
dimension = ' кг'; |
OlderNewer