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

hoverer

v1.3.1

Published

make text appear on hover

Downloads

36

Readme

Hoverer

About

Hoverer is a library for creating a text box which displays additional information that appears upon hovering on top of an HTML element.

An example image

installation

To install you can either use npm:

npm i hoverer

Or just download the one file from github.

Either way to include the file in your project simply link it in your HTML:

<body>
  <script src="node_modules/hoverer/hoverer.js" defer></script>
</body>

Usage

To apply the hoverer effect to an element you can use one of 2 methods:

  1. Through js using the applyHoverer function:

    applyHoverer(myElement, "some text");
    
    // Results in a text box saying 'some text' that shows up when the mouse hovers over `myElement`.

    With this function you can set a specific pice of text that will show up on hover.

  2. Through html with a data attribute. When doing it this way, you can choose between 2 different data attributes:

    1. data-hoverer-text:

      <p data-hoverer-text="some text">pice of text</p>
      
      <!-- Results in a text box saying 'some text' that shows up when the mouse hovers over the p element. -->

      With this attribute you can set a specific pice of text that will show up on hover.

    2. data-hoverer-infer:

      <img src="someImage.png" alt="an image" data-hoverer-infer="alt" />
      
      <!-- Results in a text box which displays the content of the 'alt' property of the img element ('an image') and shows up when the mouse hovers over the img element. -->

      With this attribute you can make hoverer display a pice of text that is based on one of the element's properties that will show up on hover.

      You can also set the attribute to 'auto' and make hoverer decide which property to infer:

      <a href="someImage.png" data-hoverer-infer="auto">a link</a>
      
      <!-- Results in a text box which displays the content of the 'href' property of the `a` element ('an image') and shows up when the mouse hovers over the img element. -->

What's New In version 1.3.x?

In this release a couple of modifications where made to the size and positioning of the text box to match how the effect traditionally works in other programs.

For those who don't like the changes, do know that we are working on a data-hoverer-options data attribute and respective js function, which you can try out by downloading the file from the data-hoverer-options branch on github. Do note that the branch is still in alpha, so it may lack some features and it won't be well documented.

Otherwise you can just download an older version of the package:

npm i [email protected]