Lazy Load the swiper slider images when it is not in viewport - slider

I am currently using Swiper 5.3.7. Everything works fine except the Lazy Loading.
I am using a separate Lazysizes for Lazy Loading images in the site.
And I am aware that Swiper slider provides Lazy Loading only for images that are inside the slider(Active/Inactive slides).
When I am using Lazysizes with Swiper's Lazy Load, Lazy Load works perfect until I reach the viewport. Once I am in the viewport, it loads all the images of the slides irrespective of the active/inactive state(which means Swiper's lazy loading is not working when combined with Lazysizes).
Expected Outcome:
Swiper Lazy Load should be enabled when the page reaches the viewport. Till then Lazysizes will control the images loading.

Related

Viewport position changes when loading more items using vue-masonry library

I am using the vue-masonry library. At first I have 6 items, so I crated a LoadMore Button to see more of them. The problem is, that when I am in mobile, the items load perfectly, but the viewport changes. see the image attached.
Is there something I can do, to prevent the scrolling movement?

jqueryLazy not triggering when images gets visibles via css changes

I have a bunch of images, say 100 images, in a web page, and only 10 are visible without scrolling the page. The first 90 images have a "myclass" class.
I manage all images with jquery lazy (http://jquery.eisbehr.de/lazy/), and it works perfecty if I scroll the window.
However, If I make $(".myclass").hide() before scrolling down, I see the last 10 images, which don't have the "myclass" class, bug jquery lazy doesn't "reveal" them.
Why?
Because lazyload triggers on scroll events.
$(window).scroll() (which triggers the scroll event on the window) is enough to solve the issue.
If the scrollable div is not the window object, use it instead of $(window).

How to detect map container resize due to slow loading image?

I am creating an app with a Leaflet map in Nuxt using Vue2Leaflet plugin.
I am having a problem though: I am using Bootstrap columns to size the map and accompanying image, but the image loads too slow (this cannot be resolved at this time), so the container is not the proper size when the map loads.
This causes the map to be half grey. I have attempted to call map.invalidateSize() in the mounted event, but even that must be happening before the image finishes loading.
I have setup a sandbox at: https://codesandbox.io/s/eager-bohr-c3453?file=/src/App.vue
In order to see the bug, you have to view the rendered app at https://c3453.csb.app/ (the internal codesandbox render does not show the problem)
I think I need some way to wait until the image has completed loading (so the BS col is the proper size), then call map.invalidateSize(), but I am not sure how...
You can attach an onload listener on your <img>, so that you can call (again?) your Leaflet map invalidateSize() method.

Flexslider flickers while loading

Flexslider is not working fine in my sites, they always flicker on load.
http://bgk.copperspoke.ca/
I used all CSS hacks.
Feel free to suggest other sliders, I am open to try new
Just want smooth sliding of images

iScroll5 Infinite scrolling - lazy loading

A am developing a list based app, wherein I am tryin to use iScroll5 to implement lot of animations and smooth scrolling functions. I would like to do lazy loading of my contents wherein I want to load first 50 list elements to DOM and based on user scroll event asynchronously bind the next set of list elements to the DOM.
Am I on the right track to go with the iScroll5 - Infinite scrolling API or is there any other library which does the job for me ?
If you want to use infinite scrolling , means on page load some content are pre load and then user scroll down and other content are load on scroll with lazy loging, if i am understan right then please try to use jscroll jquery plugin.. it's very good for infinite scroll.
http://jscroll.com/ you can find here document and example of this plugin.
Regards,
vinit