Code Monkey home page Code Monkey logo

easy.js's Introduction

Easy_base_v3.js --- 简易JavaScript库

2016-06-20

数据类型

	Undefined Null String Number Array Object Function Date Regexp
	Ej.type() => 返回数据类型字符串
	Ej.is(o,string);//判断数据 o === string,返回布尔值 

针对的数据判断 - 返回布尔值 false || true

	Ej.isUndefined
	Ej.isNull
	Ej.isString
	Ej.isNumber
	Ej.isBoolean
	Ej.isArray
	Ej.isLikeArray => 判断类数组
	Ej.isObject
	Ej.isFunction
	Ej.isDate
	Ej.isRegExp
	Ej.isElement => 判断是或是Element(个人感觉欠缺)
	Ej.isWindow

选择器

	使用:querySelector || querySelectorAll
	Ej(selector, parent);
	Ej.qs() => 选择单个元素
	Ej.qsa() => 选择多个元素

DOM

	Ej.create(string, option); // 创建DOM,option => 添加dom属性、css属性 或 data-*
	Ej.remove(dom); //移动dom
	Ej.replace(newNode, oldNode); //替换DOM
	Ej.contains(parent, child, containSelf); //判断元素 parent 是或包含 child
	Ej.append(elem, parent); //向parent元素内 后面 追加DOM
	Ej.prepend(elem, parent); //向parent元素内 前面 追加DOM
	Ej.before(elem, dom); // 向DOM元素位置前 添加elem
	Ej.after(elem, dom); //向DOM元素位置后 添加elem
	Ej.index(elem, doms); //判断dom 是或在 doms元素中,或在元素 子元素中
	Ej.isHidden( dom ); //判断dom是或隐藏
	Ej.siblings(dom, selector); // 获取dom的同级元素

classLists

	Ej.hasClass()
	Ej.addClass()
	Ej.removeClass()
	Ej.toggleClass()
	Ej.replaceClass()

css

	Ej.toDomStyle() => 'transform-style' -> 'transformStyle'
	Ej.toCssStyle() => 'transformStyle' -> 'transform-style'
	Ej.testCss() => 检测css3属性支持 
	Ej.css();
	Ej.css(dom, 'cssName');//返回css属性值
	Ej.css(dom, 'cssName', 'cssValue') || Ej.css(dom, {'cssName':'cssValue',...});//设置css属性值

事件

	Ej.on() => 添加事件
	Ej.off() => 移除事件
	Ej.one() => 添加一次性事件

Ajax

	Ej.Ajax() 
	Ej.get()
	Ej.post()
	Ej.load();//可加载img、script
	Ej.getJSONP() => 跨域
	Ej.toStr() => 参数object 转 string {a:1,b;2} => a=1&b=2

Cookie

	Ej.Cookie.set => 设置
	Ej.Cookie.get => 获取
	Ej.Cookie.del => 清除

效果

	Ej.show(dom, option); //显示dom
	Ej.hide(dom, option); //隐藏dom
	option => option.time : 时间;option.isScale : 是或缩放;option.callback : 完成回调;

其他

	Ej.keys => 兼容 Object.keys;
	Ej.indexOf => 兼容 Array.prototype.indexOf
	Ej.filter => 兼容 Array.prototype.filter

	Ej.each => 遍历 Array、Object;
	Ej.toArray => 类数组 转数组

	CSS3属性:
	Ej.isTransform 
	Ej.isPerspective
	Ej.isTransition
	Ej.isAnimation

	requestAni
	cancelAni

easy.js's People

Contributors

xudaobing avatar

Stargazers

 avatar  avatar

Watchers

 avatar 木白 avatar

Forkers

yeemaster

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.