Skip to content

Instantly share code, notes, and snippets.

View mtmzorro's full-sized avatar
🌌
Warp Drive Active

mTmzorro mtmzorro

🌌
Warp Drive Active
View GitHub Profile
function insertScript(url, attr) {
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
if ( attr ) {
for ( var k in attr ) {
if ( attr.hasOwnProperty(k) ) {
script.setAttribute(k, attr[k]);
var searchUnit = {};
/**
* [resizeOnebox 接受oneBox iframe内内容高度 并修改]
* @param {[String]} height [iframe 内高度]
*/
searchUnit.resizeOnebox = function(height){
if(typeof height !== 'undefined'){
height = height < 700 ? 700 : height;
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var sass = require('gulp-sass');
var lr = require('tiny-lr'),
refresh = require('gulp-livereload'),
server = lr();
var myUtil = (function() {
var jsonpMethods = {},
head = document.getElementsByTagName('head')[0],
jsonpCount = 0;
var getJSON = function(url, params, callbackFuncName, callback) {
var paramsArr = [],
jsonp = 'jsonp_' + new Date().getTime() + '_' + (jsonpCount++);
for (var key in params) {
paramsArr.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key]));

IE6.0
url最大长度2083个字符,超过最大长度后无法提交。

IE7.0
url最大长度2083个字符,超过最大长度后仍然能提交,但是只能传过去2083个字符。

firefox 3.0.3
url最大长度7764个字符,超过最大长度后无法提交。

Opera 9.52

x 尺寸 用处 0 800*800 原图

1 350*350 商品页主图

2 160*160 商品列表图

3 130*130 商品列表图

4 100*100 商品列表图

.mask{
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
z-index: 9999;
overflow: hidden;
background-color: rgba(61, 67, 76, 0.7);
background-image: -webkit-radial-gradient(rgba(0, 0, 0, 0) 10%,rgba(0, 0, 0, 0.6));
//============================================================
//
// easing
//
// Thanks to Robert Penner for his sterling work on easing,
// and to Matthew Lein for converting these functions into
// approximated cubic-bezier functions. Respect.
//
// @see http://robertpenner.com/
// @see http://matthewlein.com/ceaser/
@mtmzorro
mtmzorro / gray.css
Created November 26, 2013 02:52
setGray 置灰 哀悼 阿门
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: url(desaturate.svg#grayscale);
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
-webkit-filter: grayscale(1);
@mtmzorro
mtmzorro / getHashProbability.js
Last active December 28, 2015 15:29
数据概率分布
/**
* [getHashProbability hash概率]
* @param {[String]} strNum [源数据]
* @param {[Number]} baseNum [基数 分母]
*/
function getHashProbability(strNum, baseNum){
// hash算法
function hashCode(str) {
for (var result = 0, i = 0; i < str.length; i++) {