Giter VIP home page Giter VIP logo

Comments (2)

IsraelThompson avatar IsraelThompson commented on May 18, 2024

Hah! NVM, I think I've got it!

I needed to use $('#element').trigger('teardown'), then simply load the new $('#element').reel(options)... I bet there was something binded, that I was missing!

Izz

from reel.

pisi avatar pisi commented on May 18, 2024

Hey Izz!

Great job figuring it out! Honestly. This is a fairly frequently asked question and not many can answer it by themselves, like you. And you are precisely right. I added this question & answer to the FAQ wiki and reposting it below to provide some explanation on what's happening there.

.pisi

When I manually remove the DOM node Reel is running in, I’m then unable to initialize another Reel in the same place. Am I doing something wrong?

Not really. Let me explain. Reel maintains a list of its instances in the document (you can peek in it in $.reel.instances). The direct removal of the DOM node does indeed kill the running instance, but doesn’t clear the record from this list, and its ongoing presence then prevents you from re-initializing the instance. Make sure to .trigger("teardown") event on the instance first. The “teardown” event effectively tears down the running Reel instance structure along with the list entry and reconstructs the original naked IMG node. Then, you can switch the node’s src and do .reel() all over again.

from reel.

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.