New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lory.js

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lory.js

Touch enabled lean slider using Vanilla JavaScript & latest technologies without any compromises for fallbacks.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-40.73%
Maintainers
1
Weekly downloads
 
Created
Source

Touch enabled lean slider using vanilla JavaScript & latest technologies without any compromises for fallbacks.

license npm

build code climate devDependencies

##Install with node

npm install --save lory
var lory = require('lory');

##Install with bower

bower install lory --save

##Prerequisited markup

<div class="slider js_simple simple">
    <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

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

    .slides {
        display: inline-block;
    }

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

Integration

    <script>
        'use strict';

        document.addEventListener('DOMContentLoaded', function() {
            var simple = document.querySelector('.js_simple');

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

Integration of multiple sliders on one page

    <script src="js/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>

##Options

slidesToScrollslides scrolled at oncedefault: 1
slideSpeedtime in milliseconds for the animation of a valid slide attemptdefault: 400
rewindSpeedtime in milliseconds for the animation of the rewind after the last slidedefault: 600
snapBackSpeedtime for the snapBack of the slider if the slide attempt was not validdefault: 200
easecubic bezier easing functions: http://easings.net/dedefault: 'cubic-bezier(0.455, 0.03, 0.515, 0.955)'
rewindif slider reached the last slide, with next click the slider goes back to the startindex.default: false

##Callbacks

beforeInit:executed before initialisation (first in setup function)
afterInit:executed after initialisation (end of setup function)
beforePrev:executed on click of prev controls (prev function)
beforeNext:executed on click of next controls (next function)
beforeTouch:executed on touch attempt (touchstart)
beforeResize:executed on every resize event

Browser Support

  • Chrome
  • Safari
  • FireFox
  • Opera
  • Internet Explorer 10+

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

FAQs

Package last updated on 20 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc