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

lory-lesara.js

v2.2.3

Published

Touch enabled minimalistic slider written in vanilla JavaScript. Added optional parameter 'forceIndexUpdate'

Downloads

302

Readme

NOTICE: This is a minimally patched version of the original lory.js v 2.2.1. The only addition here is an optional switch forceIndexUpdate that is false by default and can be set to true. If set to true, index will also be updated when the offset of the nextIndex is outside the range of the maxOffset (which can happen when the total number of slides is not an exact multiple of slidesToScroll). This way we can have a slideshow that slides all slides in view (not only a fixed amount of slides) which makes it more responsive-design-friendly, and have the "next"-arrow/button disappear when the end of the slides is reached and we do not want to have endless slides. This was not possible with the original version of lory.js. Since we'll use it on https://www.lesara.de, the name of this patched fork is lory-lesara.js.

The reason for this fork is that we want to use Lory.js (with this additional option) as an npm package and the pull request I created on the original github repository hasn't yet been processed. I will probably not maintain this package any further since it already does what it should do. But please feel free to contact me in case of questions.

Please visit: http://meandmax.github.io/lory/ for the original version Please visit: http://RSeidelsohn.github.io/lory-lesara/ for the forked and minimally enhanced version

Touch enabled minimalistic slider written in vanilla JavaScript.

license npm CDNJS

build code climate devDependencies js-standard-style

Join the chat at https://gitter.im/meandmax/lory semantic-release Commitizen friendly

Sauce Test Status

Download

lory-lesara is released under the MIT license & supports modern environments. There is also a prebundled CDN version of the original (unpatched) lory.js which you can use:

Vanilla JavaScript: https://cdnjs.cloudflare.com/ajax/libs/lory.js/2.2.0/lory.min.js

jQuery plugin: https://cdnjs.cloudflare.com/ajax/libs/lory.js/2.2.0/jquery.lory.min.js

Install with node:

npm install --save lory-lesara.js

Consume it as an ES2015 module:

    import {lory} from 'lory.js';

    document.addEventListener('DOMContentLoaded', () => {
        const slider = document.querySelector('.js_slider');

        lory(slider, {
            // options going here
        });
    });

Consume it as an commonJS module:

    var lory = require('lory.js').lory;

    document.addEventListener('DOMContentLoaded', function() {
        var slider = document.querySelector('.js_slider');

        lory(slider, {
            // options going here
        });
    });

Install with bower

bower install lory-lesara --save

Local development

// To install dev dependencies run:

npm install

// To start the development server run:

npm run dev

// To lint your code run:

npm run lint

// To make a full new build run:

npm run build

Run tests

// To install dev dependencies run:

npm install

// To start the karma tests locally run:

npm run karma-local

Prerequisited markup

<div class="slider js_slider">
    <div class="frame js_frame">
        <ul class="slides js_slides">
            <li class="js_slide">1</li>
            <li class="js_slide">2</li>
            <li class="js_slide">3</li>
            <li class="js_slide">4</li>
            <li class="js_slide">5</li>
            <li class="js_slide">6</li>
        </ul>
    </div>
</div>

Prerequisited css

/**
 * (optional) define here the style definitions which should be applied on the slider container
 * e.g. width including further controls like arrows etc.
 */
.slider {}

.frame {
    /**
     * (optional) wrapper width, specifies width of the slider frame.
     */
    width: 880px;

    position: relative;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    white-space: nowrap;
}

.slides {
    display: inline-block;
}

li {
    position: relative;
    display: inline-block;

    /**
     * (optional) if the content inside the slide element has a defined size.
     */
    width: 880px;
}

Integration

<script src="js/lory.min.js"></script>
<script>
    'use strict';

    document.addEventListener('DOMContentLoaded', function() {
        var slider = document.querySelector('.js_slider');

        lory(slider, {
            // options going here
        });
    });
</script>

Integration as a jQuery Plugin

<script src="dist/jquery.lory.js"></script>
<script>
    'use strict';

    $(function() {
        $('.js_slider').lory({
            infinite: 1
        });
    });
</script>

Integration of multiple sliders on one page

<script src="dist/lory.js"></script>
<script>
    'use strict';

    document.addEventListener('DOMContentLoaded', function() {
        Array.prototype.slice.call(document.querySelectorAll('.js_slider')).forEach(function (element, index) {
            lory(element, {});
        });
    });
</script>

Public API

Options

Events

Getting Help

Please, do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on StackOverflow where maintainers are looking at questions tagged with loryJS.

StackOverflow is a much better place to ask questions since:

  • There are hundreds of people willing to help on StackOverflow
  • Questions and answers stay available for public viewing so your question / answer might help someone else
  • The StackOverflow voting system assures that the best answers are prominently visible.

To enforce this rule will be systematically closing all the issues that are requests for general support and redirecting people to StackOverflow.

Browser Support

  • Chrome

  • Safari

  • FireFox

  • Opera

  • Internet Explorer 10+

  • Internet Explorer 9 (graceful, without transitions + classlistp)

    • graceful, without transitions
    • you need to polyfill classlist (https://github.com/eligrey/classList.js/)

Copyright

Copyright © 2015 Maximilian Heinz, contributors. Released under the MIT License