Giter VIP home page Giter VIP logo

Comments (16)

dkern avatar dkern commented on May 24, 2024

Hello @ipetrov87,

could you create a jsfiddle for me, where you can reproduce the problem? Then I would like to investigate. For now, the only idea i have, is a wrong use of the plugin. But that dosen't mean there could not be a bug. 😉

Thanks!

from jquery.lazy.

ipetrov87 avatar ipetrov87 commented on May 24, 2024

I try to create the jsfiddle, but no success. I use something like this but it is still working in all browsers. I have no idea what can be the problem. Do you have any ideas, what i can check?

from jquery.lazy.

dkern avatar dkern commented on May 24, 2024

So you could not recreate the problem? Well, I'm glad abaout that! ;)

The fact, that the images somethimes shows for a second but then disappear could be a indicator that some strange css kicks in. Or maybe you got some old js somewhere, doing it? Or maybe somthing with your responsive things? I saw the class img-responsive in your example.

Lazy would not touch an element again after it was handlet once. So if a image is loaded the plugin will not remove it. And you say the loading works fine too. To there is no generally problem. But without seeing the code and the problem it is very difficult to detect the issue ...

from jquery.lazy.

dkern avatar dkern commented on May 24, 2024

I close this here, because this seems not to be a problem of the plugin. Feel free to response, if you have any other questions left.

from jquery.lazy.

ipetrov87 avatar ipetrov87 commented on May 24, 2024

I was leave this problem for a while because there was some other more important stuff to do, but now i am back. I trying with this

afterLoad: function(element) {
  console.log(element);
}

In console i get only 2 empty row, from first two images that should be loaded. Witch it strange for me. Then i start to scroll down the page so I expect to see more empty rows, but there is nothing like the Lazy is not triggered. If you have any idea what can be, or what to check just say.

I also use onError event

onError: function(element) {
  console.log('error loading ' + element.data('src'));
}

but i don`t get any of them in console.

from jquery.lazy.

dkern avatar dkern commented on May 24, 2024

It's still hard to say without seeing the code. And it is only in Safari?
Any way to upload the page / code and let me take a look there?

from jquery.lazy.

ipetrov87 avatar ipetrov87 commented on May 24, 2024

I can give a link to the page, but page is still in development. Can you give some e-mail to send it to you?

from jquery.lazy.

ipetrov87 avatar ipetrov87 commented on May 24, 2024

I have check the page on IPhone 6S Plus it is the same.
With dev tools on IPhone 6S Plus i am abble to see that console prints this:

[0: <img id="product-collection-image-1298">]
  0 : img#product-collection-image-1298.img-responsive
  0 : img#product-collection-image-1298.img-responsive

On a windows Chotme i get only one img, like this:

[0: <img id="product-collection-image-1298">]
  0 : img#product-collection-image-1298.img-responsive

I am start to think some king of multiple jQuery import. I Make a search scripts and find that i have a jquery-1.10.2.min.js and jquery-1.11.1.min.js. But even if I remove one of then i still face same problem, and still see "Dublicated" images in console.

from jquery.lazy.

dkern avatar dkern commented on May 24, 2024

Yes, send it to jquery at eisbehr .de.

from jquery.lazy.

ipetrov87 avatar ipetrov87 commented on May 24, 2024

You should receive a email from me now.

from jquery.lazy.

dkern avatar dkern commented on May 24, 2024

Yes, it's here. Check your mails too. 😉

from jquery.lazy.

attrib avatar attrib commented on May 24, 2024

What was the solution here at the end?

Running in the same issue with Safari only. Would be good to know where I have to look into.

from jquery.lazy.

dkern avatar dkern commented on May 24, 2024

I'm not 100% sure anymore, but I think it was a missing DOCTYPE tag in the html document.

from jquery.lazy.

ipetrov87 avatar ipetrov87 commented on May 24, 2024

I think that in the example #39, that I use for AJAX calls, was missed to be added bind: "event" to configuration. Check this answer. Let us know if that helps.

from jquery.lazy.

attrib avatar attrib commented on May 24, 2024

It was neither of both, but still thanks for the quick answers.
After a long day of debugging today I found out that Safari is hanging as soon as I added document.onreadystatechange.

I changed now to DOMContentLoaded Event and fallback to load Event for my custom JS. Safari uses the fallback and DOMContentLoaded is never fired. No clue why and which other used lib is doing this, but maybe somebody else stumbles over it and this helps.

from jquery.lazy.

lnilya avatar lnilya commented on May 24, 2024

I encountered a similar problem (images load fine in chrome and FF but in Safari nothing happens) and after debugging could pin point it to Safari not triggering window's load event for some reason, or it is triggered earlier than my scripts (enqueued in Wordpress, very standard).
This leads to _initialiaze never being called and images remaining empty.

My workaround now is to trigger window load event manually after defining the lazy elements. Its not pretty, but it did the work for now.

window.dispatchEvent(new Event('load'));

from jquery.lazy.

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.