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
/*Геолокация. Определение местонахождения клиента(страна, город..) и дальнейшее использование данных местонахождения. | |
Так же необходимо подключить апи Яндекса в индексную страницу: | |
<script src="https://api-maps.yandex.ru/2.0-stable/?load=package.standard&lang=ru-RU" type="text/javascript"> </script> | |
Готовая реализация на странице : http://testall.grytsenko.in.ua/foursoft/thanks.html*/ | |
ymaps.ready(function(){ | |
var geolocation = ymaps.geolocation, | |
geolocationCountry = geolocation.country; |
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
import HP from './helpers'; | |
(function ($) { | |
// При нажатии на кнопку редирект на страницу Гугл | |
$(".submit-btn").click(function() { | |
location.href ='http://google.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
//JS | |
$(".modal").magnificPopup(); | |
//html | |
/* | |
<a href="#modal" class="modal">обратный звонок</a> | |
<!-- MODAL START --> |
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
// Отмена обычного поведения ссылки в html(убираем резкий переход по ссылке). | |
$("а").click(function(evt) { | |
evt.preventDefault (); | |
}); | |
//или так. return false указвается после всех действий в теле функции, т.е. в конце. | |
$("а").click(function() { | |
return 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
gulp.task('buildSass', function () { | |
gulp.src(`./${Paths.src}/${Paths.scss}/app.scss`) | |
.pipe(sourcemaps.init({loadMaps: true})) | |
.pipe(sass(/*{outputStyle: 'compact'} вставляем если нужен не минифицированный код css*/).on('error', function (err) { | |
showError.apply(this, ['Sass compile error', err]); | |
})) | |
.pipe(gcmq()) | |
.pipe(cssnano({safe: true})) // нужно закоментировать для отключения минификации файла css | |
.pipe(autoprefixer('last 3 versions')) | |
.pipe(sourcemaps.write('./')) |
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
Работа с Git в SublimeText: | |
Если мне надо отправить все изменения на сервер, то весь процесс выглядит так: | |
ctrl + shift + p, печатаю add | |
ctrl + shift + p, печатаю quick, затем набраю текст коммита | |
ctrl + shift + p, печатаю push | |
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> с классом 'stop'. | |
$('li').each(function(i,elem) { | |
if ($(this).hasClass("stop")) { | |
alert("Остановлено на " + i + "-м пункте списка."); | |
return false; | |
} else { | |
alert(i + ': ' + $(elem).text()); | |
} |
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 defaultPrefix = $(".country-phone-selected").html(); | |
//извлечение содержимого тега | |
var defaultPrefix = $(".country-phone-selected").text(); |
OlderNewer