Code Monkey home page Code Monkey logo

elevatezoom-plus's Introduction

Current Version: 1.2.5

EZ Plus is an up-to-date jQuery image zoom plug-in based on EZ

Features

  • Fully Customisable
  • Coloured Tints
  • Fancybox-Plus and Colorbox Gallery Support
  • Variable zoom on mouse scroll
  • External Controls
  • Window Zoom, Lens Zoom and Inner Zoom
  • Touch support
  • Free to use under MIT
  • JQuery plug-in
  • AngularJS directive available: angular-elevatezoom-plus

Supported Browsers

  • Chrome
  • IE7+
  • Firefox
  • Edge
  • Safari

Installation

Via Bower:

bower install ez-plus

Via npm:

npm install ez-plus

In a browser:

<script src="https://cdn.jsdelivr.net/gh/igorlino/[email protected]/src/jquery.ez-plus.js"></script>

Getting Started

Include jQuery and the plug-in on a page. Include your images and initialise the plug-in.

<img id="zoom_01" src='images/large/image1.png' />

<script>
    $('#zoom_01').ezPlus();
</script>

For more information on how to setup and customise, check the examples.

Do you have a question?

The issue tracker is for issues, in other words, bugs and suggestions. If you have a question, please use Stack Overflow, your favorite search engine, or other resources. Due to increased similar type of questions, we can no longer answer questions in the issue tracker.

License

Licensed under MIT license.

elevatezoom-plus's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elevatezoom-plus's Issues

Zoom Issues

So when using the plugin with default settings, it will fit the whole image, and not zoom the large image:

gallery

Original images:
small
large

If anyone knows how to fix this, it's working fine on some larger images:
working

inner zoom in different div ?

  1. Can you specify
    where the ZOOM image will be displayed ?
  2. Can you "move" SELF image to different location , to different div maybe ?
    because ZOOM div is parent of image so for the time-being of ZOOM I would like to specify new div for image lens preview.

Zoom size check bug

Zoom size defined with minZoomLevel and maxZoomLevel is checked after size changes but should be checked before.

EXAMPLE:

config:

minZoomLevel:  1
maxZoomLevel: 3

results in:

minZoomLevel: 0.9
maxZoomLevel: 3.1

This is not a problem unless you use scrollZoomIncrement option with higher value like 2 or 3.

zoomType: 'inner' on mobile

Maybe it could by on mobile like
Click or doubleclick fires zoom and image is zoomed then u can slide your finger to show the rest of the image.
Another click or double click stops inner zoom.

Display problem with small zoom images

I use this plugin for a shop-type app where users upload their own product images so I don't have control over the size of images being used.

I've found that if the images used for the zoom are smaller than the zoomWindowHeight / zoomWindowWidth the zoomWindow goes a bit weird - especially when combined with the scrollZoom feature.
Currently the image is fixed in the top left corner of the zoomWindow with a white border around it - not a major problem but equally not ideal.
The bigger issue is when you zoom (via scrollZoom), the image zooms in but doesn't scroll when you move the mouse - it remains fixed to the top left corner.

My current workaround is to use the onShow callback with
onShow: function(self) {
var img = new Image;
img.src = self.zoomImage;
var bgImgWidth = img.width;
var bgImgHeight = img.height;
if (bgImgWidth < self.options.zoomWindowWidth) {
self.options.zoomWindowWidth = bgImgWidth;
$(self.zoomWindow).width(bgImgWidth);
}
if (bgImgHeight < self.options.zoomWindowHeight) {
self.options.zoomWindowHeight = bgImgHeight;
$(self.zoomWindow).height(bgImgHeight);
}
}

This resizes the zoomWindow down to the size of the zoomImage if it is smaller than the current size.

It's probably not the best solution but I think there should probably be something along these lines built in to handle this situation.

CDN is not working

Cant use the CDN [https://cdn.rawgit.com/igorlino/elevatezoom-plus/1.1.20/dist/jquery.ez-plus.min.js]

404 Not Found

Update docs

It would be nice to have docs updated.

There are handy options like:

  • zoomLevel - initial zoom
  • minZoomLevel
  • maxZoomLevel

dependency missing on grunt wiredep

Hello,

thanks for this great plugin.
i having a trouble when i'm using grunt wiredep on angular apps, the jquery.ez-plus.js not injected into my index.html.
After further investigation i found that you have

"main": [
        "dist/jquery.ez-plus.js",
        "css/jquery.ez-plus.css"
 ],

in your bower.json file, you set the jquery file on 'dist' folder while you have it on 'src' folder.
Edit: (i solved this issue by changing the 'dist' to 'src' in the bower json, but just in case other people have the same trouble)

Thank You,

npm install not working

Running:
npm install elevatezoom-plus or npm install angular-ez-plus throws an error indicating that such components are not part of the npm registry... Actually those are not available on https://www.npmjs.com

Not working on portrait sized images

Hi,

eZ is a nice plugin so nice job on extending it. This issue I'm reporting is almost similar to the original eZ plugin whereas images that are more taller (portrait view) do not seem to work well with the plugin.

This happens with the 'inner' mode. It works on landscape sized images where widths are greater than the height, but for portrait images no, see below is the gif screenshot of the issue:

not working on portrait

responsive gallery

Hi,

I'm using the elevate zoom with a gallery. I'm trying to get it to work on a responsive site, I'm updating the zoomWrapper and image widths and heights when the window resizes, but once you click on a gallery item it resets. is there a way to run my code on the gallery click event? also on init?

Invalid CSS "px solid", border not effective on "inner" zoomType

I noticed that the function getInnerZoomStyle() in line 198 contains invalid CSS:

'px solid ' + self.options.borderColour + ';' +

Obviously, there is something missing, I also noticed that a similar function for zoomType "window" contains a border, so I suppose a copy/paste went bad at some point.

The line 198 should probably look like this:

'border: ' + String(self.options.borderSize) + 'px solid ' + self.options.borderColour + ';' +

Now, you get a proper border set based on the borderSize parameter and properly coloured based on the borderColour parameter.

Need option to specify z-index

It's a nice to have since this plugin doesn't need much custom css, so rather than putting

.zoomWindowContainer > div{
  z-index: 100!important;
}

to the stylesheet, why not have this option on the initialization itself?

loading icon/spinner placement and hide

I found two issues that affect my "inner" zoomType code.

  1. The loading icon (spinner) does not appear on top of the image, instead it appears below. I had to add "top:0px;" to line 1278, for proper placement.

  2. After switching between gallery images for several times, multiple loading icons appear underneath the images while they load. It seems like they are never removed. The line 1279 creates loading icons, but they are never remove()'ed from the DOM, they are only hidden at line 1490. To fix this, I added a class to the loading icon object, and use .remove() within donecallback.

Keyboard Support For Galleries

Is it possible to use the arrows (forwards and backwards on keyboard) to navigation the gallery images when Elevate Zoom has a gallery enabled? I know that when you enable the lightbox it works but it does NOT work otherwise. Support for both would be amazing!

onComplete is never called

The callback onComplete() is currently never called.

It could be called in line 558, but then it'd be called multiple times if selector in $(selector).ezPlus() matches multiple elements. Is this the expected behavior?

Gallery images with varying sizes/aspect ratio

I'm using a gallery of images, with the images being constrained within a specific range of resolutions between 180x240 to 360x480 and everything in between.

This means that the images have all kinds of resolutions and aspect ratios, for example one image is 360x461 and another is 340x480.

The script as it is, does not compensate when switching between the images in the gallery. It will set zoomContainer and zoomWindow sizes for the first image and expects that all subsequent images have the same size.

My solution, was to add a few lines of code to recalculate zoomContainer and zoomWindow when a new image is loaded by the gallery. I added the following lines inside the doneCallback function (below line 1529).

            // Custom resize
            var newWidth = $('img.mainimage').width() + "px";
            var newHeight = $('img.mainimage').height() + "px";
            self.zoomContainer.css({ "width": newWidth, "height": newHeight });
            self.zoomWindow.css({ "width": newWidth, "height": newHeight });

I hope this helps.

Hi, the zoom section is far to the top left of page after couple of zooming.

Hi,

I appreciate your contribution. It helps me save time a lot. However, I just spotted a small issue out. After zooming a couple of zooming, the zoom container appear at the left top of the page. I do not know how to fix it. I have gotten stuck here for several days. Look at the pictures.
1
2

Please help me.

Thanks,
Justin.

Add id tag to .zoomContainer

source: elevateweb/elevatezoom#118

It adds {image#id}-zoomContainer id to the new .zoomContainer elements.
It allows to completely remove an elevateZoom associated to an image with id tag, by selecting the zoomContainer associated to an image with the id selector.
This is crucial for multi elevateZoom images in carousels, where the image moves and the zoomContainer was covering elements on the page.

Options zoomWindowOffetx??

For some reason, the documentation (in both the examples and API) specifies using the property "zoomWindowOffetx" for offsets on the x-axis, this property doesn't actually exist and instead you need to use "zoomWindowOffsetX", might be worth updating the documentation?

Is zoomLevel working on lens mode?

It seems zoomLevel is not working. I have a single image not 2.

Maybe as a workaround I could use scrollZoom : true, and then manually set the delta without the user using the mousewheel, but I did not find how to do it.

What can I do on this case?

Images do not swap

Hello,

I have the zoom working on the main image but I can't get the images to swap.

I'm using a loop to populate the gallery...
//Main Image
Model.ImageAltTag

//loop to populate gallery

<script> //elevate zoom II $(window).load(function () { $('#product-image').ezPlus({ gallery: 'product-image-gallery', galleryActiveClass: 'active', imageCrossfade: true, }); }); </script> <script> $(window).load(function () { $('#product-image').bind('click', function (e) { var ez = $('#product-image').data('ezPlus'); ez.closeAll(); //NEW: This function force hides the lens, tint and window //$.fancyboxPlus(ez.getGalleryList()); return false; }); }); </script>

Please adivse

Zoom container width and height not set in lens mode on re-size

We're finding ez-plus adds some good functionality to our site.

We've noticed that when the browser starts off small and is re-sized to a larger size, the left and top positions of the zoom container are recalculated correctly in responsive mode. However the width and height of the container are not re-calculated so it remains of a small size.

Amending the code to the following appears to fix the problem:

        //container fix
        self.zoomContainer.css({
            top: self.nzOffset.top,
            left: self.nzOffset.left,
            width: self.nzWidth,  // new code
            height: self.nzHeight // new code
        });

Show loading for single image

I'm using this plugin to show inline zoom inside a bootstrap modal.
The high-res image I'm showing is really big and I would like to show a loading gif.
I tried setting "loadingIcon" without success.

In source code I see loadingIcon is only shown for galleries.
Can it be shown also for single image loading?

Tint Window Size with Irregular Sized Images

I have a gallery with 2 images, the first 100x300 and the second 300x100.

After loading with tint=true, the tint window is 100x300. Then, click on the 2nd thumbnail and click on the preview image. The tint window is still 100x300 when it should be 300x100.

I have tracked it down to the SwapAction function and the elemHeight and elemWidth are not yet updated. I am not sure yet of the fix, but will contribute if I can find it.

Thanks
Matt

Touch move for window zoom mode

I'm trying activate window zoom mode on touch move, but I noticed it only works for inner zoom mode (see Line 366).

Does anyone know why it's restricted to inner zoom mode?
It seems to work fine if I just comment out the condition...

Wrong offset of zoomContainer when ZoomContainerAppendTo is used (in modal) and fix?

Hi, thanks for trying to continue this library :)

When appending a zoomContainer to a bootstrap modal the position of the zoomContainer gets messed up when the modal i placed in a scrolling position.

This is because the zoomContainer position gets its own position wrong if you have specified the "ZoomContainerAppendTo" option (which is not documented in ez-plus either?).

The position of the container gets placed relative to the Document, not the element specified by ZoomContainerAppendTo (.modal in this instance) as it should.

We should be able to fix this by checking if zoomContainerAppendTo is set and fixing the nzOffset appropriately by subtracting the top-offset of the ZoomContainerAppendTo element from the main element ( self.$elem.offset(); )

To elaborate:

Several places throughout the codebase you get the position of the element:

         self.nzOffset = self.$elem.offset();

So a fix would be to remove all instances of that line with a line that checks if ZoomContainerAppendTo is set and subtracts its position.

        if (self.options.zoomContainerAppendTo != 'body') {
            self.nzOffset = self.$elem.offset();
                appendedPosition = $(self.options.zoomContainerAppendTo).offset();
            self.nzOffset.top = self.$elem.offset().top - appendedPosition.top;

        } else {
            self.nzOffset = self.$elem.offset();
        }

Thereby always getting the correct offset.

This doesn't work somehow though? Event though i can see through console.log that the correct values are present in the self.nzOffset object.

Is anyone able to shed some light on why this doesn't work? Somehow the top position on the ZoomContainer element is still being set with the wrong non-subtracted value.

I can't seem to find where it gets set. To make it even weirder. If hardcode the top value set in line 642
to zero, it works in my particular case. Not a good hack though.

Responsive?

Hi. I don't see the responsive part working yet. Could you provide an example on how to rescale the imageZoom class so the image gets as big as the div it is in.

Expected an assignment or function call and instead saw an expression

While minifying the script, I got an error at line 545 about a missing name after . operator, which led me to run jshint on the script, which in turn produced the following error, again at line 545:

jquery.ez-plus.js: line 545, col 18, Expected an assignment or function call and instead saw an expression.

1 error

The offending line is:

self.delete;

I see no reason why it should be there, so I've removed it.

touchEnabled: false

I have an image that has zsPlus on it with a hyperlink surrounding the image tag. I have set touchEnabled to false. If i tap the image on a touch device (iPad in my case) the zoom feature is still triggered. I have to tap the image again to navigate to the link.

Shouldn't touchEnabled: false disable the zoom feature on touch enabled device?

Scrollable container issue

Hello,

First, thanks for the plus version of elevate zoom.

I have a problem on my project with the plugin: i am using scrollable div and elevatezoom in this div is trigerred when i hover rest of my page.

I have tried many options but i cant fix that... Any idea?

Thanks,

zoom

On bootstrao modal the zoom effect is not working

The zoom effect is not working properly in bootstrap modal . the zoom window is not opening properly

`$('.qvpopup').click(function(se){
    var image = $('#qvfeaturedimg');
    var zoomConfig = {cursor: "crosshair"};
    var zoomActive = false;


        se.preventDefault();
        $('#quickview').on('shown.bs.modal', function() {
             zoomActive = !zoomActive;
            alert('start');
             if(zoomActive)
             {

                 image.ezPlus(zoomConfig);//initialise zoom
             }
             else
             {
                $.removeData(image, 'ezPlus');//remove zoom instance from image

                $('.zoomContainer').remove();// remove zoom container from DOM
              }


      });`

link of image you can see here how it is showing i don't know is it css issue of modal

you can check here scroll to down click on product tab and then hover on image and click on quick view button then popup will appear where you can see all the things

Minify

It would be a good idea to repo the /dist folder with minified files. This makes it lighter to consume via CDN.

Responsive feature does not destroy zoomContainers

The responsive feature works but it has some serious problem not removing previous zoom containers right after every window resize:

issue

Here's my code:

The site I'm developing is on a responsive layout with elements being fluid (always width 100% of its container) such as the image and the zoom window container so we can expect that they always change sizes.

Maybe it should be attached to an event after on resize so that it won't create containers every step, but still I think there should be something that handles this.

Zoom level adjustment

Is it possible to adjust the zoom level for lens zoom?

I want to zoom in to a more detailed level. Currently, it can only zoom in, about 2 times larger than the original image.

I changed zoomLevel: 1, //default zoom level of image to other values but it seems that the lens image cannot match the original image anymore (shifted out of proportion). Am I missing changing other options?

Any help is appreciated!

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.