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

preloading/load on demand #86

Open
Telrik opened this issue Aug 30, 2017 · 3 comments
Open

preloading/load on demand #86

Telrik opened this issue Aug 30, 2017 · 3 comments
Labels

Comments

@Telrik
Copy link

Telrik commented Aug 30, 2017

Hi
I use now original version. have problem i have like 200 thumbnails on page
and if ez preloads ALL big images at start it's like take alot of time and traffic.
i see in plugin code line
preloading: 1, //by default, load all the images, if 0, then only load images after activated (PLACEHOLDER FOR NEXT VERSION)

but it's never used.. so it's kinda not realized in this plus version of plugin as well ?
right now i use this code .. problem is on onZoomedImageLoaded event zoom window is not appearing
automatically.

  $('img.ezoom-ondemand').hover(function () {
            var _this = $(this);
            var elevateZoom = _this.data('elevateZoom');
            if (typeof elevateZoom === 'undefined') {
                _this.css('cursor', 'wait');
                _this.elevateZoom({
                    tint: true, scrollZoom: true, tintColour: '#337ab7', borderSize: 1, tintOpacity: 0.5, onZoomedImageLoaded: function () {
                        _this.css('cursor', 'pointer');
                    }
                });
            } else {
                //console.log('already');
                //elevateZoom.changeState('enable');
            }
        }
    );
@igorlino
Copy link
Owner

Ok, tricky question.

Maybe you can trigger manually the event you want?

element.trigger('the-event');
(http://api.jquery.com/trigger/)

What event? you have to decide on your code.

@poebrand
Copy link

Similar issue here... would like to load image on demand or at least have the option.

@daniel-richter
Copy link

My solution:

$("selector_for_your_images").each(function() {
  $(this).mouseover( function(event) { 
    $(this).ezPlus(); 
    $(this).unbind(event); 
  })
});

ezPlus is not initialized until the first mouseover (and thus the images are loaded on demand).

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

No branches or pull requests

4 participants