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

global-dropdown

v1.0.2

Published

Simple, easy to use and small in size plugin. Based on pure Javascript.

Downloads

2

Readme

Global-DropDown (A simple pure javascript based DropDown plugin)

Simple, easy to use and small in size plugin. Based on pure Javascript.

#View Demo

View Global Drop-down live demo.

Getting started

###Installation

Quick Start with GIT with Documentation

git clone https://github.com/shudhuiami/global-dropdown.git

Quick Start with NPM

  • Install with NPM npm install global-dropdown

###Usage

####JavaScript

Import app.js

<script src="global-dropdown/app.js" type="text/javascript"></script>

OR

@import 'global-dropdown/app.js';

####HTML

#####Important Parts:

  • data-query="dropdown-wrapper"
  • data-query="dropdown-trigger"
  • data-query="dropdown-box"

Those parts should not be changed and structured as follow.

    <div class="dropdown-wrapper" data-query="dropdown-wrapper">
        <a class="action-triiger" data-query="dropdown-trigger">DropDown-1</a>
        <div class="dropdown-box" data-query="dropdown-box">
            <ul>
                <li><a href="#">Home</a></li>
                <li><a href="#">Product</a></li>
                <li><a href="#">About us</a></li>
                <li><a href="#">Contact us</a></li>
            </ul>
        </div>
    </div>

You can design or create the inner element as you want.

####CSS style as you want but basic structure should be like this.

#####Important Parts:

  • The Drop-down element(dropdown-box) should have a class called _active as following css shows.

.dropdown-wrapper {
  position: relative;
  width: auto;
  height: auto;
  display: table;
  float: left;
  margin: 0 20px;
  .action-triiger {
    width: 100px;
    height: 40px;
    line-height: 40px;
    float: left;
    background-color: #fff;
    color: #222;
    cursor: pointer;
    border: 1px solid #dfdfdf;
  }
  .dropdown-box {
    position: absolute;
    left: 0;
    top: 100%;
    width: 200px;
    height: auto;
    display: table;
    background-color: #fff;
    border: 1px solid #dfdfdf;
    visibility: hidden;
    padding: 10px 0 0 0;
    ul {
      margin: 0;
      padding: 0;
      li {
        list-style: none;
        a {
          padding: 5px 20px;
          width: 100%;
          display: block;
          text-decoration: none;
          color: #222;
          text-align: left;
          box-sizing: border-box;
          border-bottom: 1px solid transparent;
          &:hover {
            border-bottom: 1px solid #dfdfdf;
          }
        }
      }
    }
    &._active {
      visibility: visible;
    }
  }
}

##That's all have fun.