npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gjtool

v1.2.5

Published

gjTool.js is a javascript class library(前端轻量js类库)

Downloads

15

Readme

gjTool

Build Status npm version npm downloads

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

作者:Gao Jin 邮箱: [email protected]

语言

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

插件: