GithubHelp home page GithubHelp logo

customd / jquery-list Goto Github PK

View Code? Open in Web Editor NEW
43.0 21.0 11.0 301 KB

A plugin to make lists with group headers that float while-you-scroll, ala iOS contacts.

License: MIT License

JavaScript 100.00%

jquery-list's Introduction

jQuery Floating/Fixed List Header Plugin

This is a jQuery plugin which allows the user to create a list with floating headings while scrolling, a-la iOS & iCal day view. The plugin allows arbitrary markup of the header and list items, and will work nicely with nested elements.

Demos

The Demos for this plugin live under the examples/ directory. Open them directly in your web browser, or view the following online examples:

The following are Demos not included in the examples/ directory and can only be viewed online:

Documentation

Basic list setup

The basic setup will work with any standard dl element with no extra config options.

$('dl').list();

If you want to use the plugin with any other HTML structure, you can use the 'headerSelector' setting to tell the plugin what elements to use as headers.

$('ul').list({ headerSelector : 'li.header' });

Other capabilities include methods which will scroll the list to any heading, with optional animation, and a method which will report the current heading that the user sees. You can also bind to an event which will fire whenever the currently viewed heading changes.

$('dl').list().bind( 'headingChange', myFunction );

Full plugin documentation

The Documentation for this plugin lives under the docs/ directory. Open it directly in your web browser, or see the online documentation.

jquery-list's People

Contributors

pacoguzman avatar shivahuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery-list's Issues

How could I have the way to manually refresh list header?

Sometime the header of the list is not correct due to some problem with scrolling or DOM caching (I found this problem on jquery mobile while page swapping).

I would like to know how can I have a function that only refresh the current header to make sure that header still update according to the list position.

Does the markup have to be exact same?

Hi there,

Excellent plugin!

However, I've got a quick question. Does the markup have to be exactly the same?

<dl>
 <dt>Heading 1</dt>
 <dd>Item 1</dd>
 <dd>Item 2</dd>
 <dd>Item3></dd>
 <dt>Heading 2</dt>
 <dd> Item 4</dd>
 <dd>Item 5</dd>
 </dl>

Or can I have a different markup like below ie. each set of dt and dd would be wrapped by a containing div?

e.g. the above would be rewritten like below

  <dl>
  <div>
    <dt>heading 1</dt>
    <dd>Item1</dd>
    <dd>Item2</dd>
     <dd>Item3</dd>
   </div>

     <div>
     <dt>heading 2</dt>
     <dd>Item4</dd>
       <dd>item5</dd>
      </div>

      </dl>

Any ideas?

Headers dont change during scrolling on iOS with -webkit-overflow-scrolling

I have noticed an issue. If you use -webkit-overflow-scrolling:touch on iOS the headers don't change until after the user has stopped scrolling. This is probably because on iOS, the scroll event only gets fired when scrolling has stopped. One solution would be to use ontouchmove/start events along with the scroll event to change the headers with animation while the user is scrolling..

Header text flickers while scrolling up the list

If you have "Header 1" and "Header 2", and have scrolled down so Header 2 is stuck to the top of the screen, when you scroll back up to the point where Header 1 displaces it, the "Header 2" text will briefly flicker to read "Header 1" and then back again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.