yyx990803 / zoomerang

drop in zoom anything

Home Page:http://yyx990803.github.io/zoomerang/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

img width percentage doesn't work

hueitan opened this issue · comments

Thanks for this cool plug-in !

Again percentage problem

http://plnkr.co/edit/lpBfmp

<img width="250px" src="..." /> <!-- Work -->
<img width="50%" src="..." /> <!-- Doesn't work -->

Does using style="width:50%" work?
This is should be relatively easy to fix if the above works.

<img style="width: 50%" src="...">

Works in demo http://plnkr.co/edit/lpBfmp

But the size didn't increase

and it's better if we can set it on attribute width

Hey @huei90 after looking at your demo, I think the problem is that the default zoomerang size is set to be 300px. In the external script that you've added the listener too, set the config options for maxHeight and/or maxWidth. For example:

      window.onload=function(){
        Zoomerang.config({
          maxWidth: 1000,
          maxHeight: 1000
        })
        Zoomerang.listen('img')

Now if we could define maxHeight or maxWidth to as percentage like 100% (i.e. original image full size), that'd truly be sweet. :)