Comments (6)
Hi,
There is no "refresh" function for the moment.
One solution would be to call chocolat $('selector').Chocolat()
after elements are dynamically added.
Maybe i can help you more if you provide some code snippets.
Best regards,
from chocolat.
I think I'm having the same issue?
An example would be:
$('#container').load('/foo.html #container .image');
$('#container').Chocolat();
Let's say I'm on index.html, and I load an array of elements (.image
) into the #container
on index.html… when I call Chocolat() it doesn't register the dynamically loaded elements.
from chocolat.
I suspect there's an issue with this.element.find(this.settings.imageSelector);
in the constructor. With dynamically loaded content, you'd need to opt for delegation, so you'd have to do something like this.element.on('click.chocolat', this.settings.imageSelector, function(){});
but then of course things get more complicated when trying to find the index of the given element.
from chocolat.
@matyus Hi !
In your case you just need to use deferred callback for example :
$('#container').load('/foo.html #container .image', function() {
$('#container').Chocolat();
});
from chocolat.
@nicolas-t oh wow, thanks! I totally forgot .load takes a callback.
from chocolat.
i'm closing, feel free to reopen if you have any question
from chocolat.
Related Issues (20)
- linkImages: false passed, but images linked and controls shown HOT 1
- Not an issue.
- Closing lightbox (from full-screen mode) using Esc throws TypeError HOT 2
- No mobile support HOT 1
- question/feature_request(markup): disable wrapper HOT 3
- feature_request(enhancement): thumbnails bar HOT 1
- page-layout is moving HOT 2
- Description issue HOT 2
- Firebug: Uncaught SyntaxError HOT 1
- Fullscreen close does not work in safari HOT 3
- Did not appear as expected HOT 5
- Exiting fullscreen mode doesn't completely close the overlay HOT 2
- Licensing for commercial projects
- Filename as image title HOT 3
- Chocolat not working with IE11 HOT 7
- Convert three variable assignments to the usage of compound operators
- Add buttons for rotating an image HOT 1
- Keyboard Accessibility issues HOT 1
- Safari Image Opening Issue
- Transition times in CSS variable HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chocolat.