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.splitter

v0.29.1

Published

jQuery Splitter is plugin that split your all children with movable splitters between each of them.

Downloads

1,467

Readme

jQuery Splitter

npm bower

jQuery Splitter is plugin that split your content with movable splitter between them.

Example

var splitter = $('#foo').height(200).split({
    orientation: 'vertical',
    limit: 10,
    position: '50%', // if there is no percentage it interpret it as pixels
    onDrag: function(event) {
        console.log(splitter.position());
    }
});
<div id="foo">
    <div id="leftPane">Foo</div>
    <div id="rightPane">Bar</div>
</div>

Limitations

You need to set the height of the container for splitter to work.

You can use this css:

.container {
  height: 100vh !important;
}

to force full height.

If you have wrappers inside left or right splitter and you create another splitter inside:

<div class="splitter"
  <div class="left">
    <div class="wrapper">
       <div class="top"></div>
       <div class="bottom"></div>
    </div>
  </div>
  <div class="right">
  </div>
</div>

wrapper is not directly inside left, so it will not get the full height (this is how CSS work), so in order to fix this case, you need to set the wrapper to proper height. Most likely you want:

.splitter .wrapper {
  height: 100%;
}

to fit full height of the left splitter.

Options

  • orientation - string 'horizontal' or 'vertical'.
  • limit - number or object {leftUpper: number, rightBottom: number} that indicate how many pixels where you can't move the splitter to the edge.
  • position - number or string with % indicate initial position of the splitter. (from version 0.28.0 you can use array of numbers or percents for multiple panels, array length need to have the same number as there are splitters so children.length - 1).
  • onDrag - event fired when draging the splitter, the event object is from mousemove.
  • percent - boolean that indicate if spliter should use % instead of px (for use in print or when calling the window).
  • ignoreTags - a string with a comma separated list of html tags that should be ignored when creating splitter, default "script,style,link" (included in version 0.29.0).

Methods

Instance returned by splitter is jQuery object with additional methods:

  • refresh()
  • option (name[, value]) - option setter/getter
  • position(number)|position([num1, num2, ...])|position() - position setter/getter (if you have 2 panels you can use single number to set the position for more panels you need to use array with panels - 1 same as number of splitters)
  • isActive - returns boolean
  • destroy() - remove splitter data

Demo

http://jquery.jcubic.pl/splitter.php

Patch Contributors

License

Copyright (C) 2010-2020 Jakub T. Jankiewicz <https://jcubic.pl/me> Released under the terms of the GNU Lesser General Public License