Skip to content

Instantly share code, notes, and snippets.

View igorpronin's full-sized avatar

Igor Pronin igorpronin

View GitHub Profile
@igorpronin
igorpronin / js
Last active November 23, 2015 12:30
Закрытие попапа по клику вне его
// Без комментов
$(document).mouseup(function(e) {
var div = $("#popup-element");
if (!div.is(e.target) && div.has(e.target).length === 0) {
$('#popup-element').addClass('hidden');
// $('#popup-element').hide(); // еще способ скрыть.
}
});
@igorpronin
igorpronin / js
Last active April 10, 2019 05:36
Аяксовая отправка формы + попап на плагине Magnific Popup + блокировка формы во время работы Аякса + функция сброса формы
// Объявление попап-функций. Плагин Magnific Popup
var openSucsessPopup = function() {
$.magnificPopup.open({
items: { src: '#sucsess-popup' },
type: 'inline',
fixedContentPos: false,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
@igorpronin
igorpronin / config.rb
Created October 25, 2015 08:15 — forked from nathansmith/config.rb
Example config.rb file for Compass
preferred_syntax = :sass
http_path = '/'
css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
relative_assets = true
line_comments = true
# output_style = :compressed
@igorpronin
igorpronin / css
Created September 17, 2015 14:38
CSS // Sticky Footer
html, body {
margin: 0;
padding: 0;
}
html {
min-height: 100%;
position: relative;
}
@igorpronin
igorpronin / js
Created September 13, 2015 09:39
Следить за событиями на странице
// набирать в консоли
// запуск функции
monitorEvents(document.body); // Следить за всеми событиями
monitorEvents(document.body, "mouse"); // Следить за событиями мыши
monitorEvents(document.body, "key"); // Следить за событиями клавиатуры
monitorEvents(document.body, "touch"); // Следить за событиями прикосновений к экрану
monitorEvents(document.body, "control"); // Следить за событиями resize, scroll, select и пр.
@igorpronin
igorpronin / html, js, ajax, php, sql
Last active August 29, 2015 14:27
Ajax example 1, get method
-------client side
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Работа с json</title>
<link rel="stylesheet" href="/jslibs/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="/jslibs/bootstrap/dist/css/bootstrap-theme.min.css">
</head>
@igorpronin
igorpronin / gist:5ece1a8dbc0da6a63705
Last active January 26, 2021 08:51
Git commands, Git usage
Перенес все в мой ман: https://github.com/igorpronin/my-mans/blob/master/git/_git.md
git config --global user.name "User Name" // set user name
git config --global user.email "[email protected]" // set user email
git config --list // show active settings
git help commit // open git manual in browser
cd c:/targetdir // change directory
git init // create git repository in this directory or reinit existing
git status // show info about files status (untracted / unmodified etc)
git add . // add all files to unmodified status
@igorpronin
igorpronin / js
Created August 16, 2015 17:16
jQuery check and change attribute value on click
$("#click_tag").click(function() {
if ($("#target_tag").attr("attr_name")==("attr_value1")) {
$("#target_tag").attr("attr_name", "attr_value2");
} else {
$("#target_tag").attr("attr_name", "attr_value1");
}
});
@igorpronin
igorpronin / html, css
Created August 15, 2015 16:03
HTML, CSS / Выравнивание нижнего края элемента по центру окна браузера
HTML
<div class="wrap">
<div class="content"> </div>
</div>
CSS
.wrap {
background-color: green;
@igorpronin
igorpronin / html, css
Created August 15, 2015 14:53
HTML, CSS / Выравнивание элементов по центру по вертикали, горизонтали. Способ 3. Современный, математический.
Работает в новых браузерах. IE - от 10.
---
HTML
<div class="wrap">
<div class="content"> </div>
</div>
<div class="wrap">