Skip to content

Instantly share code, notes, and snippets.

View katerynajeeva's full-sized avatar

Kate Oliinyk katerynajeeva

  • Kiev, Ukraine / Koh Phangan, Thailand
View GitHub Profile
$.fn.isolatedScroll = function() {
this.bind('mousewheel DOMMouseScroll', function (e) {
var delta = e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.detail,
bottomOverflow = this.scrollTop + $(this).outerHeight() - this.scrollHeight >= 0,
topOverflow = this.scrollTop <= 0;
if ((delta < 0 && bottomOverflow) || (delta > 0 && topOverflow)) {
e.preventDefault();
}
});
<script>
(function() {
'use strict';
angular.module('TRKUA').directive('isolateScroll', function () {
return {
restrict: 'A',
link: function ($scope, element, attrs) {
element.on('mousewheel DOMMouseScroll', function (e) {
var delta = e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.detail,
bottomOverflow = this.scrollTop + $(this).outerHeight() - this.scrollHeight >= 0,
@katerynajeeva
katerynajeeva / viewport-units-ios.scss
Created November 18, 2016 13:43 — forked from BenMorel/viewport-units-ios.scss
SCSS mixin to support vh and vw units on all iOS Safari versions. Based on an idea by Patrick Burtchaell's: https://gist.github.com/pburtchaell/e702f441ba9b3f76f587
/**
* Fix for vw, vh, vmin, vmax on iOS 7.
* http://caniuse.com/#feat=viewport-units
*
* This fix works by replacing viewport units with px values on known screen sizes.
*
* iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix.
* Target devices running iOS 8+ will incidentally execute the media query,
* but this will still produce the expected result; so this is not a problem.
@katerynajeeva
katerynajeeva / is-numeric.js
Created August 8, 2016 11:46
Function isNumeric that checks that number is a number (not NaN/Infinity/-Infinity, not true/false/''/null)
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
@katerynajeeva
katerynajeeva / module.js
Created June 30, 2016 11:26 — forked from kovaldn/module.js
JS : good module
// Объявление модуля
var myModule = (function () {
// Инициализирует наш модуль
function init () {
_setUpListners();
};
// Прослушивает события
function _setUpListners () {
@katerynajeeva
katerynajeeva / 0_reuse_code.js
Created June 13, 2016 10:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@katerynajeeva
katerynajeeva / index.pug
Created June 8, 2016 12:01
Svg Social Icons Set for PUG (Jade) and CSS
// facebook
// viewBox="0 0 32 32"
svg(height='0', width='0', style='position:absolute;margin-left: -100%;')
path#iconFb(d='M20.146,16.506h-2.713c0,4.031,0,8.994,0,8.994h-4.021c0,0,0-4.914,0-8.994h-1.912v-3.177h1.912v-2.056 c0-1.472,0.752-3.773,4.058-3.773l2.978,0.011v3.085c0,0-1.811,0-2.161,0c-0.353,0-0.854,0.164-0.854,0.865v1.868h3.065 L20.146,16.506z')
// google plus
// viewBox="0 0 32 32"
svg(height='0', width='0', style='position:absolute;margin-left: -100%;')
path#iconGp(d='M23.896,11.107V7.512h-1.798v3.595h-3.593v1.797h3.593v3.593h1.798v-3.593h3.595v-1.797H23.896z M17.585,7.5 c0,0-4.135,0-5.6,0c-2.841,0-5.21,2.096-5.21,4.401c0,2.355,1.556,4.233,4.229,4.233c0.186,0,0.366-0.011,0.542-0.023 c-0.174,0.333-0.297,0.704-0.297,1.093c0,0.654,0.359,1.027,0.805,1.46c-0.336,0-0.661,0.009-1.016,0.009 c-3.254,0-5.532,2.24-5.532,4.389c0,2.116,2.746,3.439,6,3.439c3.709,0,5.989-2.104,5.989-4.221c0-1.697-0.365-2.551-2.174-3.906 c-0.52-0.39-1.649-1.188-1.649-1.725c0-0.627,0.179-0.937,1.125-1.676c0.968-0.757,1.653-1.7
@katerynajeeva
katerynajeeva / index.html
Last active June 8, 2016 10:11
Svg Social Icons Set for HTML and CSS
<!-- facebook -->
<!-- viewBox="0 0 32 32" -->
<svg height="0" width="0" style="position:absolute;margin-left: -100%;">
<path id="iconFb" d="M20.146,16.506h-2.713c0,4.031,0,8.994,0,8.994h-4.021c0,0,0-4.914,0-8.994h-1.912v-3.177h1.912v-2.056 c0-1.472,0.752-3.773,4.058-3.773l2.978,0.011v3.085c0,0-1.811,0-2.161,0c-0.353,0-0.854,0.164-0.854,0.865v1.868h3.065 L20.146,16.506z" />
</svg>
<!-- google plus -->
<!-- viewBox="0 0 32 32" -->
<svg height="0" width="0" style="position:absolute;margin-left: -100%;">
<path id="iconGp" d="M23.896,11.107V7.512h-1.798v3.595h-3.593v1.797h3.593v3.593h1.798v-3.593h3.595v-1.797H23.896z M17.585,7.5 c0,0-4.135,0-5.6,0c-2.841,0-5.21,2.096-5.21,4.401c0,2.355,1.556,4.233,4.229,4.233c0.186,0,0.366-0.011,0.542-0.023 c-0.174,0.333-0.297,0.704-0.297,1.093c0,0.654,0.359,1.027,0.805,1.46c-0.336,0-0.661,0.009-1.016,0.009 c-3.254,0-5.532,2.24-5.532,4.389c0,2.116,2.746,3.439,6,3.439c3.709,0,5.989-2.104,5.989-4.221c0-1.697-0.365-2.551-2.174-3.906 c-0.52-0.39-1.649-1.188-1.649-1.725c0-0.6
@katerynajeeva
katerynajeeva / index.html
Last active June 21, 2016 09:41
Sticky Footer
<!DOCTYPE html>
<html>
<head>
<!-- <title>Title</title> -->
<!-- <link href="css/style.css" rel="stylesheet"> -->
</head>
<body>
<div class="wrapper">
<!-- <header class="header"></header> -->
<!-- <section></section> -->