Comments (4)
To get access to the attached images, use this snippet:
$('.fotorama').on('fotorama:load', function (e, fotorama, data) {
var $img = $('.fotorama__img', data.frame.$stageFrame);
});
from fotorama.
Thanks for that hint Artem.
That certainly helps when the image is loaded the first time, but the load event does not fire when I’m scrolling around the images and an image is redisplayed later on because it is already loaded then.
I thought the show event should do the trick but I find it hard to figure out the correct new image there (probably because it takes a moment for the animation to finish.
from fotorama.
Do you really need to get the image twice and more? I was thinking that it is enough to touch it once.
If so, try to combine the fotorama:showend
event and the private f:load
:
function catchImage ($frame) {
var $img = $('.fotorama__img', $frame);
// do something smart with $img
}
$('.fotorama')
.on('fotorama:showend', function (e, fotorama) {
var $frame = fotorama.activeFrame.$stageFrame;
if (!$frame.data('state')) {
$frame.on('f:load', function () {
catchImage($frame);
});
} else {
catchImage($frame);
}
})
.fotorama();
Also you have to add data-auto="false"
attribute to the fotorama block, to skip automatic initialization.
from fotorama.
Do you really need to get the image twice and more? I was thinking that it is enough to touch it once.
I do: there is only one image zoomer which is just transferred to the current image. So I need to know when that happens.
If so, try to combine the fotorama:showend event and the private f:load:
Indeed that does the trick!
Thanks again
from fotorama.
Related Issues (20)
- Внедрение fotorama в wordpress
- Caption always inside image (left) HOT 1
- Wrong direction logic for 'data-click="true"' with 'data-direction="rtl"'
- How open fullscreen when clicking on a large active picture?
- Is it possible to alter the iframe tag for Videos
- How to set fullscreen zoom size?
- Vimeo Video Not Working/Stopped Loading HOT 5
- Exit full screen mode throws js error
- Youtube thumbnail preview quality
- hidden thumbnails at small devices
- All Icons Are Same HOT 1
- Custom Thumbnails?
- Multiple galleries on one page — arrow key doesn't work on second one?
- fotorama.io not loading HOT 1
- Set amount of images diferent on default and on fullscreen
- Маленький формат галереи при первой загрузке странице
- How to force play and not download the video
- Different thumbnail size according to screen resolution
- Navigation arrows when video is loaded? HOT 1
- Is this lib reached end-of-life cycle 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 fotorama.