Skip to content

Instantly share code, notes, and snippets.

View ivan-khuda's full-sized avatar
🎯
Focusing

Ivan Khuda ivan-khuda

🎯
Focusing
  • TechMagic
  • Lviv
View GitHub Profile
// https://wicg.github.io/IntersectionObserver/#intersection-observer-private-slots
/*
callback IntersectionObserverCallback = void (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer)
[Constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options),
Exposed=Window]
interface IntersectionObserver {
readonly attribute Element? root;
readonly attribute DOMString rootMargin;
@ivan-khuda
ivan-khuda / Swipe-Example.js
Created June 24, 2019 13:03 — forked from Tam/Swipe-Example.js
Vanilla JavaScript Swipe Detection
new Swipe(document.getElementById("gallery"), function(event, direction) {
event.preventDefault();
switch (direction) {
case "up":
// Handle Swipe Up
break;
case "down":
// Handle Swipe Down
break;
var MGUtil={
data:[],
ini:0,
total:0,
addItem:function(qty,id,properties,callback) {
var params = {quantity:qty,id:id};
if(properties != false){
params.properties = properties;
}
$.ajax({