Coder Social home page Coder Social logo

tiny-slider-implementation's Introduction

Implement tiny slider dynamic load

As replacer for owl carousel, tiny slider bring minimal and great solutions without depend on jquery. This tiny library is behave like previous owl carousel with almost the same results, but for spesific use case, this library need to be tweak according to repo documentation and author suggestions. So, I made an example about, how to implement dynamic load using tiny slider library. It worked well for static content, but not for dynamic load. So we need to initiate the instance when the event was invoked. This issue was related to components like : modal, view on click, tab and etc.

Original Repository : tiny slider

Related issues:
ganlanyuan/tiny-slider#223
ganlanyuan/tiny-slider#157
ganlanyuan/tiny-slider#242

Tiny slider instance on bootstrap modal

Below, the example of, how to implement and mimic the behaviour when using tiny slider for dynamic load. Initiate tns instance when bootstrap is shown, and destroy when modal already kill/ hidden from the dom. This will generate correct behaviour. So, I think for you that comes with the same issue, you can use this as sample implementation. Thankyou

let sliderModal = null;
$('.my-modal').on('shown.bs.modal', function (event) {
    sliderModal = tns({
        container: '.js-slide-modal',
        items: 3,
        nav: false,
        slideBy: 1,
        mouseDrag: true,
        autoWidth: true,
        autoplay: true
    });
    $('.js-slide-modal').show();
    sliderModal.refresh();
});

$('.my-modal').on('shown.bs.modal', function (event) { 
    sliderModal.destroy();
});

tiny-slider-implementation's People

Contributors

ridwanzal avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.