Skip to content

Instantly share code, notes, and snippets.

View King-fly's full-sized avatar

Jack King-fly

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="width=320,user-scalable=no,initial-scale=1.0, maximum-scale=1.0" name="viewport" id="viewport">
<title>Document</title>
<link rel="stylesheet" href="css/bootstrap.css">
<script src="js/jquery.js"></script>
<style>
.container span{display: inline-block;width: 14.2%;text-align: center;border:solid 1px white;}
</style>
if (typeof Array.prototype.forEach != "function") {
Array.prototype.forEach = function (fn, context) {
for (var k = 0, length = this.length; k < length; k++) {
if (typeof fn === "function" && Object.prototype.hasOwnProperty.call(this, k)) fn.call(context, this[k], k, this);
}
};
}
if (typeof Array.prototype.map != "function") {
Array.prototype.map = function (fn, context) {
if (typeof Array.prototype.forEach != "function") {
Array.prototype.forEach = function (fn, context) {
for (var k = 0, length = this.length; k < length; k++) {
if (typeof fn === "function" && Object.prototype.hasOwnProperty.call(this, k)) fn.call(context, this[k], k, this);
}
};
}
if (typeof Array.prototype.map != "function") {
Array.prototype.map = function (fn, context) {
;(function () {
'use strict';
var startX, startY;
document.addEventListener('touchstart', function (e) {
var touches = e.touches[0];
startX = touches.clientX;
startY = touches.clientY;
~function ($) {
'use strict';
var defaultImage = '';
$.fn.imageXSS = function () {
this.each(function () {
var that = $(this)
, url = that.data('xssing')
, img = document.createElement('img');
(function($){
'use strict';
var isiOS = false,
agent = navigator.userAgent.toLowerCase();
if(agent.indexOf('iphone') >= 0 || agent.indexOf('ipad') >= 0){
isiOS = true;
}
function isEmpty(obj) {
switch (typeof obj) {
case 'string':
if (obj.replace(/(^\s+)|(\s+$)/g,'')) {
return false;
} else {
return true;
};
break;
case 'object':
;(function ($) {
'use strict';
var Tumble = function (element, options) {
this.element = $(element);
this.target = this.element.find('[data-target]');
this.options = $.extend({}, Tumble.defaults, (options || {}));
this.init();
}
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="lib/jquery.js"></script>
<style>
ul li{list-style: none;}
</style>
</head>
;(function ($) {
'use strict';
var Switch = function (element) {
this.element = $(element);
this.target = this.element.find('[data-target]');
this.pane = this.element.find('[data-pane]');
this.open = false;
this.init();
}