1 Star 0 Fork 0

gjTool / gjTool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

gjTool

Build Status npm version npm downloads

gjTool.js是一个js个人类库(PC端和移动端),支持移动端触摸滑动、捏合手势事件,模仿jQuery的链式调用,API用法和jQuery的差不多,相当于简版JQ。 支持extend方法扩展,在gjTool上增加属性、方法。gjTool.fn.extend、gjTool.extend。

作者:G.J. 邮箱: 861366490@qq.com

语言

gjTool 测试

更新信息

  • v1.2.5

  • 新增touch手势事件 pinch、 pinchin、 pinchout、 pinchstart、 pinchend

  • 修复find方法bug

安装


npm install gjtool

引用方式


import gjTool from "gjtool";  //var gjTool = require("gjtool");
<script type="text/javascript" src="gjtool.js"></script>

使用


对外暴露的全局变量是gjTool、$。

gjTool("#test").hide();//$("#test").hide(500);

API接口方法

API文档地址


选择器:
 
ID选择器、类选择器、标签选择器、通配符、群组选择器、后代选择器、属性选择器、html字符串、eq、first、last、even、odd、lt、le、gt、ge、not
例如:'#nav'、 '.subNav '、'div '、'div.test' 、'.div.abc'  、 'input[type=button]'、
'.div .ul li , #div'、  '.div ul .li'、 '.div ul li:eq(0)'、 '.div ul li:first'、'.div ul li:odd'、 '.div ul li:not(:eq(0))'

遍历:

each、map、find、 eq 、index 、parent、parents、siblings、prev、next、first、last

class操作:

addClass 、removeClass、hasClass、toggleClass

css操作:

css、width、height、offset、scrollTop、scrollLeft

属性操作:

attr、removeAttr、prop、data、val、html、text、empty

DOM操作:

after、before、append、prepend、remove、clone 、appendTo

动画:

animate、stop、show、hide、fadeIn、fadeOut、fadeTo、fadeToggle


事件:

on、off、hover、trigger、还有其他的普通事件,
文档加载完成:gjTool(function(){})、gjTool(document).ready(function(){});
例如:blur focus input load resize scroll unload click dblclick 等

Touch模块:

touch、untouch、touchstart、 touchmove、 touchend、 touchcancel、 press、 tap、 doubletap、 swipe、 swipeleft、 swiperigh、t swipeup、 swipedown、pinch、 pinchin、 pinchout、 pinchstart、 pinchend


ajax异步请求:(gjTool.ajax)

ajax、get、post、getJSON、getXML

常用工具、方法:(gjTool.each(arr,fn))

extend、 each、map、browser、now、getTime、getdate、arrSort、cloneArr、cloneObj、extendArr、objSort、setCookie、getCookie、delCookie、encrypt、decrypt、unique、getVerify

插件:

MIT License Copyright (c) [2018] [gjTool] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
JavaScript 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/gjTool/gjTool.git
git@gitee.com:gjTool/gjTool.git
gjTool
gjTool
gjTool
master

搜索帮助