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

wechat.preview

v1.0.0

Published

jQuery , Zpeto微信预览图片接口插件,use $('.groups').preview('img')

Downloads

5

Readme

wechat.preview

jQuery , Zpeto微信预览图片接口插件,use $('.groups').preview('img')

使用

引入微信SDK文件,并进行相应配置

引入wechat.preview.js

api

$('.xx').preview(options)

** option **

  • group:trueitem = false有效,标示是否对图片分组
  • event:click 触发事件,默认为click
  • autoSelector:.wx-preview-image 默认选择器.加载插件后会自动对他们初始化
  • item : img 子选择器,默认为搜有的img元素
  • attr : bgsrc item上的图片源属性名称
  • debug: false 是否打开debug功能,打开后控制台会输出信息

** 获取源优先级 **

attr > data-src > data-bgsrc > src

自动调用

<div class="wx-preview-image">
    <img src="..." alt="">
    <img src="..." alt="">
    <img src="..." alt="">
</div>

或者

<ul class="wx-preview-image" data-item="li">
	<li data-src="imgsrc">图片1</li>
	<li data-src="imgsrc">图片2</li>
	<li data-src="imgsrc">图片3</li>
</ul>

或者

<ul class="wx-preview-image" data-attr="bgsrc">
	<li bgsrc="imgsrc">图片1</li>
	<li bgsrc="imgsrc">图片2</li>
	<li bgsrc="imgsrc">图片3</li>
</ul>

手动调用

<!-- group 1 -->
<div class="group1">
    <img src="http://www.iyi8.com/uploadfile/2015/0510/20150510123008147.jpg">
    <img src="http://img.7160.com/uploads/allimg/150313/9-150313112P1.jpg">
    <img src="http://imgt7.bdstatic.com/it/u=2,816153681&fm=25&gp=0.jpg">
</div>
<script>
	$('.group1').preview()
</script>

<!-- group 2 -->
<div class="group2">
    <img class="group2-detail" src="http://imgt8.bdstatic.com/it/u=2,802432002&fm=19&gp=0.jpg">
    <img class="group2-detail" src="http://imgt9.bdstatic.com/it/u=2,815580894&fm=19&gp=0.jpg">
    <img class="group2-detail" src="http://imgt9.bdstatic.com/it/u=2,519622157&fm=19&gp=0.jpg">
</div>
<script>
	$('.group2-detail').preview({group:true,item:false})
</script>

<!-- group 3 -->
<ul class="group3">
    <li data-src="http://www.iyi8.com/uploadfile/2015/0510/20150510123008147.jpg">image element</li>
    <li data-src="http://imgt8.bdstatic.com/it/u=2,802432002&fm=19&gp=0.jpg">image element</li>
    <li data-src="http://imgt9.bdstatic.com/it/u=2,815580894&fm=19&gp=0.jpg">image element</li>
    <li data-src="http://imgt9.bdstatic.com/it/u=2,519622157&fm=19&gp=0.jpg">image element</li>
</ul>
<script>
	$('.group3').preview({
	    item:'li'
	})
</script>