Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| 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()); |
| /* | |
| * @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]] |