Skip to content

Instantly share code, notes, and snippets.

View yardfarmer's full-sized avatar

explorer yardfarmer

  • Alibaba.inc
  • HangZhou
View GitHub Profile
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
/* ========================================================================
* Bootstrap: dropdown.js v3.2.0
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
/* ========================================================================
* Bootstrap: popover.js v3.2.0
* http://getbootstrap.com/javascript/#popovers
* ========================================================================
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
@yardfarmer
yardfarmer / Class.js
Created August 19, 2014 13:48
构造自己的类
/**
* Class build my Own class
* Created by cyk on 14-8-19.
*/
/*
* 很巧妙的办法
*/
var Class = function() {
"use strict";
@yardfarmer
yardfarmer / Functionbind.js
Created August 20, 2014 05:06
Function.prototype.bind 实现方式
/**
* Created by cyk on 14-8-20.
*/
if(!Function.prototype.bind) {
Function.prototype.bind = function(obj) {
"use strict";
// 很巧妙的获取了数组的静态方法 slice
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-git2.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div>
@yardfarmer
yardfarmer / index.html
Created August 21, 2014 07:02
scrollLeft demo // source http://jsbin.com/vulor/2
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>scrollLeft demo</title>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<style id="jsbin-css">
div.demo {
background: #ccc none repeat scroll 0 0;
/**
* Full Screen plugin
* 2014-08-22 by cyk
**/
(function () {
var viewFullScreen = document.getElementById("view-fullscreen");
if (viewFullScreen) {
viewFullScreen.addEventListener("click", function () {
var docElm = document.documentElement;
var searchTimeout,
searchDelay = 300;
$('#title').on('keyup', function(event) {
clearTimeout(searchTimeout);
searchTimeout = setTimeout(function() {
$ajaxForm.triggerHandler('submit');
}, searchDelay);
});
var a = 1;
var b = ++a; // b = 2, a = 2;
a = 1;
b = a++; // b = 1; a = 2;