高阶函数 是指操作函数的函数,它接收一个或多个函数作为参数,并返回一个新函数
//返回一个新的可以计算f(g())的函数
function compose(f,g){
return function(){
//需要给f()传入一个参数,所以用call
//需要给g()传入很多参数,所以用apply
return f.call(this, g.apply(this, arguments));
首先关于 flexible 的布局规范,一直在变,不过目前已经稳定,非常的灵活和强大的布局方式。 bootstrap 4 已经支持 flexible 布局
语法:
https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius
border-radius是一种缩写方法。如果“/”前后的值都存在,那么“/”前面的值设置其水平半径,“/”后面值设置其垂直半径。如果没有“/”,则水平和垂直半径相等。另外其四个值是按照top-left、top-right、bottom-right、bottom-left的顺序来设置的其主要会有下面几种情形出现:
1、border-radius: [ {1,4} ]; //这里只有一个值,那么top-left、top-right、bottom-right、bottom-left四个值相等
2、border-radius:[ {1,4} ] [ {1,4} ] ; //这里设置两个值,那么top-left等于bottom-right,并且取第一个值;top-right等于bottom-left,并且取第二个值 3、border-radius:[ {1,4} ] [ {1,4} ] [ {1,4} ];//如果有三个值,其中第一个值是设置top-left;而第二个值是top-right和bottom-left并且他们会相等,第三个值是设置bottom-right
animation: name duration timing-function delay iteration-count direction
animation-delay Specifies a delay for the start of an animation(设置延时)
animation-direction Specifies whether an animation should play in reverse direction or alternate cycles
animation-duration Specifies how many seconds or milliseconds an animation takes to complete one cycle
animation-iteration-count Specifies the number of times an animation should be played
animation-name Specifies the name of the @keyframes animation
var Loader = (function () { | |
function Loader(options) { | |
this.options = options; | |
if (resource.scripts && resource.baseUrl) { | |
for (var i = 0; i < this.options.scripts.length; i++) { | |
this.load('js', this.options.scripts[i]); | |
} | |
for (var i = 0; i < this.options.stylesheets.length; i++) { | |
this.load('css', this.options.stylesheets[i]); | |
} |
var OB = function(){ | |
this.subscribers = []; | |
} | |
OB.prototype = { | |
constructor: OB, | |
//订阅方法,返回订阅event标识符 | |
sub:function(evt, fn){ | |
this.subscribers[evt] ? this.subscribers[evt].push(fn) : | |
(this.subscribers[evt] = []) && this.subscribers[evt].push(fn); | |
return '{"evt":"' + evt +'","fn":"' + (this.subscribers[evt].length - 1) + '"}'; |
var gulp = require('gulp'); | |
var source = require('vinyl-source-stream'); // Used to stream bundle for further handling | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var gulpif = require('gulp-if'); | |
var uglify = require('gulp-uglify'); | |
var streamify = require('gulp-streamify'); | |
var notify = require('gulp-notify'); | |
var concat = require('gulp-concat'); | |
var cssmin = require('gulp-cssmin'); |