Skip to content

Instantly share code, notes, and snippets.

View alanerzhao's full-sized avatar
🎯
Focusing

螃蟹 alanerzhao

🎯
Focusing
View GitHub Profile
function strSearch(defaultStr,searchStr){
var arr = [],
i = 0,
num = 0;
length = defaultStr.length;
for(i; i<length; i++) {
//查找字符
if(defaultStr.indexOf(searchStr,i) != -1) {
num++;
i = defaultStr.indexOf(searchStr,i);
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS3 progress</title>
<style type="text/css">
.progress{
width: 215px;
border: 1px solid #BFBFBF;
padding: 1px;
$(function() {
/*
@param mask {Boolean}
@param multiple {Boolean}
@param timeout {Number}
@param tipsCont {String}
@param autoHide {Boolean}
@param closeBack {Function}
example:
$('.btn').on('click', function() {
$(function (){
var tmpl = '<span class="text-close js-text-close" href="#"></span>',
textIpt = $(".text-ipt");
textIpt.each(function () {
var self = $(this);
$(this).after(tmpl);
$(this).next().css("display","none");
self.bind("keyup focus",function (){
if(!self.val() == ""){
$(this).next().show();
//原型链继承
//examples extend(TwoShape,Shape)
function extend (Child, Parent) {
//临时构造函数
var F = function() {};
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constructor = Child;
Child.uber = Parent.prototype;
}
var qz = {
/*
@param currentObj {Object} 当前对象 * jq obj
@param showObj {Object} 显示对象 * jq obj
@param speed {Number} 延迟时间 * not 0
@param callBack {Function} 关闭层后回调
@param current {Object} 当前回调对象
example:
qz.hoverdeLay($(".btn"),$(".tips"),200,function (current){
console.log(current.show());
@alanerzhao
alanerzhao / fun.js
Last active December 20, 2015 11:09
/*
* @return rgb(xxx,xxx,xxx)
*
*/
function getColor () {
var rgb = [];
for(var i = 0; i < 3; i++) {
//返回最接近的数
rgb[i] = Math.round(255 * Math.random());
//namespace 方法
var MYAPP = {}
MYAPP.namespcae = function (name) {
var parts = name.split('.');
var current = MYAPP;
for(var i in parts) {
if(!current[parts[i]]) {
current[parts[i]] = {}
}
current = current[parts[i]]

Git 协作流程

master 分支

master 永远处于稳定状态,这个分支代码可以随时用来部署。不允许在该分支直接提交代码。

develop 分支

开发分支,包含了项目最新的功能和代码,所有开发都在 develop 上进行。一般情况下小的修改直接在这个分支上提交代码。