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

v3.0.1

Published

A jQuery plugin that helps ease the pain when having to deal with IE z-index issues.

Downloads

677

Readme

bgiframe

Plugin has been rewritten to remove the use of CSS Expressions and to lift the restriction to IE6 only. The IE6 limitation is on by default but is now configurable by passing the conditional option. You may want to do this for instance if you are trying to layer on top of Silverlight in later IE versions. As a result of removing the CSS Expressions, you'll now need to re-run the bgiframe on elements that change their width, height, and/or borders after they are changed.

The bgiframe plugin is chainable and applies the iframe hack to get around zIndex issues. It will only apply itself in IE6 (by default) and adds a class to the iframe called 'bgiframe'. The iframe is appended as the first child of the matched element(s) with a tabIndex and zIndex of -1.

By default the plugin will take borders, sized with pixel units, into account. If a different unit is used for the border's width, then you will need to use the top and left settings as explained below.

How do I use it?

The usage is simple. Just call bgiframe on a jQuery collection of elements.

$('.fix-z-index').bgiframe();

If your element changes width, height, or border widths then you'll need to call bgiframe on those elements after the change.

Here is an example of using a different conditional and recalling bgiframe on the manipulated element.

var settings = { conditional: /MSIE/.test(navigator.userAgent) },
    $testing = $('#testing');
$testing
    .bgiframe(settings)
    .bind('click', function(e) {
        $testing
            .width( $testing.width() + 10 )
            .height( $testing.height() + 10 )
            .bgiframe(settings);
    });

Settings

The plugin tries its best to handle most situations but sometimes some configuration is necessary. The following is a list of available settings.

  • top (String|Number): The iframe must be offset to the top by the width of the top border. This should be a negative number representing the border-top-width. If a number is used here, pixels will be assumed. Otherwise, be sure to specify a unit. An expression could also be used. By default the value is "auto" which will use the elements border top width as calculated by jQuery.
  • left (String|Number): The iframe must be offset to the left by the width of the left border. This should be a negative number representing the border-left-width. If a number is is used here, pixels will be assumed. Otherwise, be sure to specify a unit. An expression could also be used. By default the value is "auto" which will use the elements border left width as calculated by jQuery.
  • width (String|Number): This is the width of the iframe. If a number is used here, pixels will be assume. Otherwise, be sure to specify a unit. An expression could also be used. By default the value is "auto" which will the offsetWidth of the element.
  • height (String|Number): This is the height of the iframe. If a number is used here, pixels will be assume. Otherwise, be sure to specify a unit. An expression could also be used. By default the value is "auto" which will use the offsetHeight of the element.
  • opacity (Boolean): This is a boolean representing whether or not to use opacity. If set to true, the opacity of 0 is applied. If set to false, the opacity filter is not applied. Default: true.
  • src (String): This setting is provided so that one could change the src of the iframe to whatever they need. Default: "javascript:false;"
  • conditional (Boolean|Function): Turn on or off the injection of the iFrame. true to turn on the iFrame and false to turn it off. Default is IE6 only conditional.

License

The bgiframe plugin is licensed under the MIT License (LICENSE.txt).

Copyright (c) 2013 Brandon Aaron