Skip to content

Instantly share code, notes, and snippets.

View extra0's full-sized avatar

Rostislav extra0

  • Ukraine, Donetsk
View GitHub Profile
@extra0
extra0 / script.js
Created May 21, 2017 12:30
Data-Toggle
// toggle class with block
$('[data-toggle]').on('click', function(){
$(this).toggleClass('active');
$(''+ $(this).attr('data-toggle') +'').toggleClass('active');
});
@extra0
extra0 / script.js
Created March 7, 2017 08:00
Клик вне области
// закрываем языковую панель по клику вне области
$(document).mouseup(function(e) {
if (langList.has(e.target).length === 0 && currentLang.has(e.target).length === 0) {
langList.slideUp('500');
currentLang.removeClass('open');
langList.removeClass('active');
}
});
@extra0
extra0 / script.js
Created February 15, 2017 09:44
Моб. устройство
// определяем мобильный ли браузер
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
@extra0
extra0 / script.js
Last active March 6, 2017 16:25
Active toggle
// toggle class active
$('[data-toggle]').on('click', function(){
$(this).toggleClass('active');
$(''+ $(this).attr('data-toggle')+'').toggleClass('active');
});
@extra0
extra0 / _header.scss
Last active March 6, 2017 16:23
Моб. кнопка меню
&-btn {
position: relative;
background: none;
border: none;
width: 36px;
height: 23px;
padding: 0;
@include transition(all 0.2s ease-in-out);
* {
display: block;