-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem in IE when Lazy Loading enabled - whitespace under slider #1107
Comments
I had similar problems, but not only in IE.
|
Unfortunately could not get this to work. The issue is specific to ie and only happens on first cycle through slides. As soon as the second cycle begins then layout becomes normal, I have used the data-lazy attribute for each image by the way . J |
I could reproduce your issue on IE 11. maybe it's your div.text. I noticed that you get a scrollbar inside the slider when resizing the browser window. you are using overflow-y: auto and height: 100%. try overflow hidden or comment the whole text div out for testing maybe this one is the culprit. |
Thanks for your help Sven. Have tried what you suggest but the div.text is not the issue. Removing made no difference. I've discovered it's the lazy loading facility in slick which must have a bug in IE. When I remove it, all is good. So I was loading each of the images like
Now I switch back to:
And the whitespace disapears. However the reason I turned on the lazy loading was because it cured a flash of all images on a fresh page load. Need to report a potential bug perhaps J |
@juliangrahame I had this issue. If you have css for the img setting the width to 100%, try changing that to max-width: 100% (if the layout will allow). |
Anyone found a solution for this? Unfortunate because without this you can't make it truly responsive with lazy load. |
We are currently trying this one: img[data-lazy] {
max-height: 50px;
} (and the 50px value is arbitrary) Not sure if it breaks anything anywhere else, but the problem seems to be related to the existence of the Will follow up here if this tests ... poorly ... |
I ended up setting autoheight to true in the options and it worked. |
Interesting. We were seeing it just measuring the |
I don't see any autoheight option in the slick slider. Are you referring to the css |
The option is called adaptiveHeight. Here is how I fixed the IE bug, I added adaptiveHeight:true and set my first image with an SRC and the following images with data-lazy. |
so in the end this is still not fixed, right? |
@kenwheeler can you help with this? |
rcherny's fix above seems to work for me, although I still need to do more extensive testing. |
Anyone solved this problem yet? if not, I tried lazy loading only first picture and then it seems to fix issue with height, but that results in 2nd picture loads first for just a second. :/ |
I ran across the same issue, found the following will work: img[data-lazy]{ |
AFAIK if you are using a placeholder image, this is not the Slick library issue, but more about the way 1px images rendered by browsers. I don't know the correct technical word to identify this. You can easily reproduce it without Slick library, just plain HTML with 1px image SRC and the non-regular target WIDTH and HEIGHT: Non-regular dimensions: Regular or square dimensions: It seems to look good with squares, but not with non-regular dimensions. The issue only applies when using lazyload ondemand, but relatively not with Progressive loading.
Some solution is proposed above. One not mentioned already is aspect ratio. You can probably set dynamic aspect ratio using your custom JS, but may result in a FOUC till JS kicks in. Using plain CSS with relevant classes may reduce such FOUC . This is just example based on above references.
Example expected markup when using the above. I know extra markups, but works consistently. If you want less markups, and don't need multiple device-dependent aspect ratio, use ::pseudo selector for the above instead.
If you are using a CMS, in my case Drupal, read more the relevant issue, otherwise ignore: Hope useful to anyone having this issue. |
I ran across the same issue on IE, this works for me:
|
[Edited to explain issue fully after further investigation and help from Sven below]
On the first load of the page, the slider height is about 3 times taller than it should be leaving lots of white-space under the .slick-slider area. After a full cycle of all slides the white-space disappears and the slider continues animating normally.
If I remove the data-lazy attribute and replace with src as normal the issue disappears.
This isn't happening on other browsers. Is this a slick issue or a css issue?
If you cannot replicate then I can arrange, please ask
Emulating other versions of IE shows this could be an IE issue in general.
J
The text was updated successfully, but these errors were encountered: