Giter Club home page Giter Club logo

tquery's Introduction

TQuery

这是一个模拟jquery的轻量js库,(当然这里包含了很多的注释代码) 实现了jquery的大部分常用方法,包括选择符,事件绑定、处理,DOM操作,ajax等等 个人使用.....

用法我就不多说了,跟jquery差不多,而且目前也就我一个人用。

兼容哪些浏览器

支持IE8+,chrome,firefox,opera等。IE8下,不定期删除某些兼容IE8下的部分。

如何添加插件?

1,源码中提供了一个extend方法,用于添加插件

格式是这样$().extend(fnName,fn); 参数:方法名,执行的方法 比如

$().extend('alert',function(){
  //do something
  alert( this );
	return this;  //返回TQuery对象,以便链式操作    $('p').css('width','500').alert().scoll()........
});
调用:
$().alert();  >>>>>>    TQuery{'elements':[],'vision':1.0,'length':0};

已经实现的方法(包括我jquery没有的)

选择器:
  • $(selectors)
  • .eq()
  • .first()
  • .last()
  • .not()
  • .filter()
  • .find()
  • .add()
  • .slice()
  • .end()
  • .has()
  • .visible()
  • .unvisible()
遍历操作:
  • .each()
  • .findParent()
  • .parent()
  • .parents()
  • .children()
  • .prev()
  • .prevAll()
  • .next()
  • .nextAll()
  • .siblings()

事件操作:

  • .ready()
  • .load()
  • .click()
  • .keydown()
  • .keyup()
  • .keypress()
  • .mousedown()
  • .mouseup()
  • .mouseenter()
  • .mouseleave()
  • .mousemove()
  • .mouseover()
  • .mouseout()
  • .hover()
  • .on()
  • .toggleClick()
  • .scroll()
  • .mouseScroll()
  • .mouseScrollUp()
  • .mouseScrollDown()
  • .bind()
  • .unbind()
  • .one()
  • .trigger()
  • .live()
  • .die()
  • .mutation()
获取尺寸及设置:
  • .width()
  • .height()
  • .innerWIdth()
  • .innerHeight()
  • .top()
  • .left()
  • .viewWidth()
  • .viewHeight()
  • .style()
  • .scrollTop()
  • .scrollHeight()
  • .scrollLeft()
  • .scrollWidth()
  • .size()
  • .offset()
属性attr的设置:
  • .prop()
  • .toggleProp()
  • .attr()
  • .toggleAttr()
  • .removeAttr()
  • .hasClass()
  • .addClass()
  • .removeClass()
  • .toggleClass()
  • .data()
  • .removeData()
CSS的操作设置:
  • .css()
  • .addStyle()
  • .removeStyle()
JS动画特效:
  • .animate()
  • .stop()
  • .show()
  • .hide()
  • .fadeToggle()
  • .fadeIn()
  • .fadeOut()
  • .fadeTo()
  • .scale()
  • .toggle()
  • .slideToggle()
  • .slideRight()
  • .slideLeft()
  • .slideDown()
  • .slideUp()
  • .scrollTo()
  • .scrollToggle()
DOM节点的操作:
  • .clone()
  • .append()
  • .appendChild()
  • .prepend()
  • .prependChild()
  • .after()
  • .before()
  • .remove()
  • .empty()
  • .html()
  • .text()
  • .val()
其他方法:
  • .proxy()
  • .delay()
  • .do()
转换:
  • .get()
  • .toArray()
  • .index()

工具集合:

  • $.type()
  • $.isNumber()
  • $.isString()
  • $.isFunction()
  • $.isArray()
  • $.isObject()
  • $.isDOM()
  • $.isWindow()
  • $.isUndefined()
  • $.ajax()
  • $.unique()
  • $.noop()
  • $.trim()
  • $.now()
  • $.reload()
  • $.toArray()
  • $.upper()
  • $.shuffleArray()
  • $.sizeof()
  • $.browser()
  • $.browser.webkit()
  • $.browser.msie()
  • $.browser.moz()
  • $.browser.opera()
  • $.merge()
  • $.map()
  • $.parseJSON()

tquery's People

Contributors

axetroy avatar

Stargazers

plh avatar Zheeeng avatar

Watchers

 avatar plh avatar  avatar

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.