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

zebra_dialog

v3.0.6

Published

A small, compact, and highly configurable jQuery plugin for creating beautiful modal dialog boxes

Downloads

857

Readme

Zebra Dialog  Tweet

A small, compact, mobile-friendly and highly configurable jQuery plugin for creating responsive modal dialog boxes

npm Total Monthly License

A modal window is a child window that requires users to interact with it before they can continue using the parent application. Modal windows are one of the most commonly used user interface elements and are used to command user awareness in order to communicate important information, or to alert of errors or warnings.

Zebra Dialog is a small (~10KB minified, 3KB gzipped), compact (one JavaScript file, no dependencies other than jQuery 1.7.0+), mobile-friendly and highly configurable jQuery plugin for creating responsive modal dialog boxes, meant to replace native JavaScript alert, confirm and prompt dialog boxes.

Can also be used as a notification widget (when configured to show no buttons and to close automatically) for updates or errors, without distracting users from their browser experience by displaying obtrusive alerts.

Screenshot Screenshot Screenshot

Features

  • great looking dialog boxes, out of the box, with 3 beautiful themes included
  • 6 types of dialog boxes available: confirmation, error, information, prompt, question and warning
  • content can also be added through AJAX calls, iFrames or from inline elements (together with attached events)
  • easily customisable appearance by editing the CSS file
  • create modal or non-modal dialog boxes
  • easily add custom buttons
  • position the dialog box wherever you want - not just in the middle of the screen
  • callback functions can be used for further customisations
  • use callback functions to handle users' choice
  • works on mobile devices
  • works in pretty much any browser (Chrome, Firefox, Safari, Edge, Opera, Internet Explorer 6+)

For the classic theme, the icons used for confirmation, information, error and question dialog boxes are made by DryIcon while the warning icon is made by Function Design & Development Studio (website is not online anymore).

For the flat theme, the icons used are made by Elegant Themes

For the materialize theme theme, the icons used are taken from Google's Material Design "design language".

🎂 Support the development of this project

Your support means a lot and it keeps me motivated to keep working on open source projects. If you like this project please ⭐ it by clicking on the star button at the top of the page. If you are feeling generous, you can buy me a coffee by donating through PayPal, or you can become a sponsor. Either way - Thank you! 🎉

Donate

Demo

See the demos

Requirements

Zebra Dialog has no dependencies other than jQuery 1.7.0+

Installation

Zebra Dialog is available as a npm package. To install it use:

# the "--save" argument adds the plugin as a dependency in packages.json
npm install zebra_dialog --save

Zebra Dialog is also available as a Bower package. To install it use:

# the "--save" argument adds the plugin as a dependency in bower.json
bower install zebra_dialog --save

How to use

First, load jQuery from a CDN and provide a fallback to a local source like:

<script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
<script>window.jQuery || document.write('<script src="path/to/jquery-3.5.0.js"><\/script>')</script>

Load the Zebra Dialog jQuery plugin:

<script src="path/to/zebra_dialog.min.js"></script>

Alternatively, you can load Zebra Dialog from JSDelivr CDN like this:

<!-- for the most recent version, not recommended in production -->
<script src="https://cdn.jsdelivr.net/npm/zebra_dialog@latest/dist/zebra_dialog.min.js"></script>

<!-- for a specific version -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/zebra_dialog.min.js"></script>

<!-- replacing "min" with "src" will serve you the non-compressed version -->

Load the style sheet file from a local source

<link rel="stylesheet" href="path/to/theme/zebra_dialog.min.css">

...or from JSDelivr CDN

<!-- for the most recent version of the "flat" theme -->
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/zebra_dialog@latest/dist/css/flat/zebra_dialog.min.css">

<!-- for the most recent version of the "default" theme -->
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/zebra_dialog@latest/dist/css/default/zebra_dialog.min.css">

<!-- replacing "min" with "src" will serve you the non-compressed version -->

Now, within the DOM-ready event do

$(document).ready(function() {

    // show a dialog box when clicking on an element
    $('#element').on('click', function(e) {
        e.preventDefault();
        new $.Zebra_Dialog('The link was clicked!');
    });

});

Configuration options

Properties

Events

Methods

close()

Call this method to manually close a dialog box.

var dialog = new $.Zebra_Dialog('This is some information');

dialog.close();

update()

Use this method to adjust the dialog box's position after content is changed dynamically, at run-time.

var dialog = new $.Zebra_Dialog('This is some information');

// change the content in the dialog box
$('.ZebraDialog_Body').html('New content');

dialog.update();

Sponsors

Cross browser/device testing is done with

BrowserStack