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

jquery.showandtell.js

v2.1.0

Published

Trigger an event when an element is being dynamically hidden or shown.

Downloads

2

Readme

showandtell.js proxies jQuery functions to emit events on show, hide, and remove events.

You want to know if an element is being dynamically hidden? This is the lib for you.

Usage

There are three events supported by this library: hide, show, and remove.

Listen on an event:

$("#myElement").bind("showandtell.hide", function() {
    alert("hide triggered");
}

...

$("#myElement").hide(); //Hides element, then triggers hide event

It's that easy. No fuzz.

Note that when hide and show trigger, the changes have already happened. remove triggers before the action has been performed (because a removed element cannot have events triggered on it).

Contributing

Any contributions/corrections are very welcome - fork aggressively! Make sure that all tests continue to pass, and that new features are tested :)

If you find an issue that you don't want to fix, please use the GitHub issue system. Thanks!

Contributors

Contributors are thanked here in public! Contributing can be with code or documentation, you decide!

Thanks a lot to the following individuals:

  • virustrinity for helping with better namespacing, so the events emitted by showandtell do not clash with other jQuery plugins. #10 #12
  • Paul Biron for contributing support for triggering events when hiding several elements with a single selector (e.g. $("#div1, #div2").hide();). #15

Background

I was working on a simple modal system when I hit a dead end. I would like to allow users to hide my modals how they usually do (with hide() or fadeOut() or whatever other jQuery method they use).

jQuery, as you probably know, does not send out events on hide. On top of that, it has a wide variety of different ways to hide an object. This library strives to add a simple unified approach to listening to hides. The goal is to cover all the possible cases.