Skip to content

Instantly share code, notes, and snippets.

View Skerth's full-sized avatar

Sergey Skerth

View GitHub Profile
@Skerth
Skerth / swipe-detect.js
Created November 21, 2017 09:00 — forked from AlexEmashev/swipe-detect.js
Simple snippet to detect swipe in jQuery without jQuery mobile. Works for touch as well as mouse input.
// Demo http://codepen.io/AlexEmashev/pen/BKgQdx
(function ($) {
$.fn.swipeDetector = function (options) {
// States: 0 - no swipe, 1 - swipe started, 2 - swipe released
var swipeState = 0;
// Coordinates when swipe started
var startX = 0;
var startY = 0;
// Distance of swipe
var pixelOffsetX = 0;
@Skerth
Skerth / html.tpl.php
Created May 5, 2017 20:49 — forked from pascalduez/html.tpl.php
Drupal 7 — Move $scripts at page bottom
<!DOCTYPE html>
<html<?php print $html_attributes; ?>>
<head>
<?php print $head; ?>
<title><?php print $head_title; ?></title>
<?php print $styles; ?>
<?php print $head_scripts; ?>
</head>
<body<?php print $body_attributes;?>>