GithubHelp home page GithubHelp logo

Comments (7)

ganlanyuan avatar ganlanyuan commented on May 4, 2024

Hi, I will take a look maybe tomorrow.

from tiny-slider.

S1SYPHOS avatar S1SYPHOS commented on May 4, 2024

Much appreciated. Turbolinks / ajax-like javascript in general are becoming a thing.
Since, as you may have noticed, I like tns, seeing them married would be great!

from tiny-slider.

ganlanyuan avatar ganlanyuan commented on May 4, 2024

I see.

  1. I didn't see container in options, are you using default .slider?
  2. And do all pages using the same structure (container and controlsContainer)?

According to turbolinks:

turbolinks:load fires once after the initial page load, and again after every Turbolinks visit. Access visit timing metrics with the event.data.timing object.
General idea:

  1. Can you try just initiate tns once?
  2. Before every Turbolinks visit, you may need run slider.destroy() to remove eventListeners, clean some memory.
  3. Since slider is supposed to change, it's better to use let.

from tiny-slider.

S1SYPHOS avatar S1SYPHOS commented on May 4, 2024

from tiny-slider.

S1SYPHOS avatar S1SYPHOS commented on May 4, 2024

Deleting window.onload + slider() function call from turbolink:load event did the trick, although I'm a little confused. Thanks anyway for the hint to load it just once 👍

from tiny-slider.

ganlanyuan avatar ganlanyuan commented on May 4, 2024

Hi, the function getSlideEdges in version 1 requests that the slides be loaded before the initialization. But I will update it later to make it work better with dynamically loaded content.
Version 2 doesn't have this issue.

Regardless of version, to initiate tns more than 1 times will probably make troubles.

Thanks for letting me know your case anyway.

from tiny-slider.

S1SYPHOS avatar S1SYPHOS commented on May 4, 2024

from tiny-slider.

Related Issues (20)

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.