Skip to content
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

Images loading instanstly #8

Closed
juergengenser opened this issue May 28, 2013 · 10 comments
Closed

Images loading instanstly #8

juergengenser opened this issue May 28, 2013 · 10 comments

Comments

@juergengenser
Copy link

I'm trying to implement unveil in a Wordpress-based site. It should target only a specific range of images - however, the images seem to load instantly, not when they are coming into the viewport.

What could be the problem here?

Thanks,
Jürgen

@TheEskhaton
Copy link

Did the console ouput any errors, what version of jQuery was included and in what browser did this happen in

@juergengenser
Copy link
Author

No console errors, jQuery version is 1.9.1 - I've tried Chrome, Safari and Firefox on Mac so far... I could share the link with you if this would be helpful?

@TheEskhaton
Copy link

Of course, send a link and I'll look into it.

@andreasbecker
Copy link

Same here. I'm trying to load PNGs. Can that be the cause?

@joeldbirch
Copy link

Just checking: @juergengenser & @andreasbecker, are you altering the img tags that WordPress outputs, somehow, so that the image's URL is stored in data-src rather than src? If not, the images will load straight away, of course.

@andreasbecker
Copy link

Problem was that width and height attributes were not set on the image tag. With them set it's working perfectly.

@joeldbirch
Copy link

Ah, that is interesting. Often, people omit width and height attributes for responsive designs, but clearly they need to remain if this plugin is to work. Thanks for the info.

@joeldbirch
Copy link

…although, relying on height attributes will result in imprecise calculations if the image is forced to scale with a responsive design, of course.

@foodini
Copy link

foodini commented Jul 12, 2013

I've seen the same everything-loads-at-page-load problem using both lazyload and unveil, even with the image width and height set. I'm just fiddling with it on a throw-away page with 1x1 black images: http://foodini.org/fingerme.cgi

@luis-almeida
Copy link
Owner

width and height attributes have anything to do with the way this plugin works. The demo page is a proof of that.
I'm closing this issue as it doesn't seem related to unveil itself but with the attempt of using in WP which I'm not familiar with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants