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

data-src image loading. #10

Open
tholman opened this issue Jul 9, 2014 · 9 comments
Open

data-src image loading. #10

tholman opened this issue Jul 9, 2014 · 9 comments

Comments

@tholman
Copy link
Owner

tholman commented Jul 9, 2014

When loading an image with data-src, there is the potential to have a situation where the image isn't loaded already, which means there is a delay opening the image for viewing... within this delay, clicking around can confuse intense.js into thinking images are open when they aren't.

The fix: Add a small spinner, which will activate when the image isn't fully loaded, and will only really be on the screen while the image loads. Clicking the background while the spinner is open, will cancel the load, and hide intense straight away.

Merging in #7 and #9 into this issue, and closing them off as duplicates, as they are each small parts of the 1 issue.

@BugHunter2k
Copy link

Is this fixed in the current version? I like your Script and I would like to use it on my photo-blog for fullscreen view.

@myconcretelab
Copy link
Contributor

Same Question and issue.

@tholman
Copy link
Owner Author

tholman commented Dec 22, 2014

It isn't yet, no :(

myconcretelab added a commit to myconcretelab/intense-images that referenced this issue Dec 22, 2014
Avoid double click on a active lightbox tholman#9 and add classes on the element for styling during image loading tholman#10
I'm not a killer in simple javascript but with jQuery, so perhaps the code is not so compatible with classes ?
@tholman tholman mentioned this issue Aug 8, 2015
@benjaminsehl
Copy link

Is there any plan to fix this? I'm barely above noob level but will have a look at the source. Any tips for where I might look for callbacks, or where I should be adding one in?

@BugHunter2k
Copy link

@bsehl this is fixed by adding state classes on the element (myconcretelab@c498df1) you are now able to add a spinner onto the images.

Simply add a new css-rule to your stylesheets to get an loading animation, something like:
(.intense is the css-class of the image, .loading is added by intense image-script, ::after adds an overlay with the loading.gif)

.intense.loading::after {
  background: rgba(255, 255, 255, 0.8) url("/image/loading.gif") no-repeat scroll center 170px;
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

Demo: http://www.ingosfotoblog.de/2015/09/05/rote-dahlie-bei-uns-am-balkon/ (klick the large image)

@tiagogon
Copy link

would love to have this fixed as well. will try the loading.gif as a preventive thing.

@panstav
Copy link
Contributor

panstav commented Jun 30, 2016

How about having a callback option for image-load-start and image-load-end?

loader.start() and .stop() could be provied via intense.config({ loader: { start: showMySpinner, stop: hideMySpinner } });

@tholman
Copy link
Owner Author

tholman commented Jul 2, 2016

Also valid, I changed the way config works slightly. But this'd definitely be the way to go

@panstav
Copy link
Contributor

panstav commented Jul 2, 2016

Right, so now it would be possible to attach a loader with both intense( elements, configObj ) AND / OR intense.config( configObj )

panstav added a commit to panstav/intense-images that referenced this issue Jul 2, 2016
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