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-formspace

v1.0.1

Published

Hides fixed navigation when form fields are focused to conserve space on smaller screens.

Downloads

2

Readme

jQuery Form Space

Hides fixed navigation when form fields are focused to conserve space on smaller screens.

Not all mobile browsers handle fixed navigations well. This plugin helps ease the pain and gain back a little screen realestate by hiding navigations whenever form fields are focussed.

Example

Before: Before After: After

Usage

Include jQuery (1.11+) and the plugin on the page:

<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://cdn.rawgit.com/heathdutton/jquery-formspace/master/src/jquery.formspace.min.js"></script>

And run the library as needed in the body:

<script type="text/javascript">
    $('body').formSpace();
</script>

Options

The following additional options are supported:

<script type="text/javascript">
    // You can target the entire body, or a specific form, etc.
    $('#mobile_form').formSpace({
        // Selector for header fixed navigation items. This default is as used in Bootstrap.
        header: '.navbar-fixed-top, .navbar-static-top',
        // Selector for footer fixed navigation items. This default is as used in Bootstrap.
        footer: '.navbar-fixed-bottom, .navbar-static-bottom',
        // The delay (in ms) after a DOM change before re-attaching to form fields.
        delay: 1000,
        // Selector for fields that we wish to detect focus on. These are fields that mobile devices will open a "keyboard" for.
        fields: 'input[type=text], input[type=password], input[type=tel], input[type=image], input[type=file], select, textarea',
        // Speed of the animation to hide.
        speed: 100,
        // Class/es to add for hiding, should CSS be needed.
        class: 'formspace_hidden',
        // Optionally use this for desktop as well.
        mobileOnly: true
    });
</script>