Comments (4)
Hi Lara!
If you look at the documentation page you'll see that the basic HTML looks like this:
<div id="zoom">
<div class="small">
<img src="demo/rushmore_small.jpg" alt="small rushmore" />
</div>
<-- the large content can be cloned from the small content -->
<div class="large">
<img src="demo/rushmore.jpg" alt="big rushmore" />
</div>
</div>
where you should set the image dimensions using css:
.zoom { width: 500px; }
.small img { width: 250px; height: 167px; }
.large img { width: 500px; height: 333px; background: white; }
Ideally, the small and large image should have the same proportions (horizontal-to-vertical ratio). For example, in the css example above, both small and large image have the same (rounded off) ratio (250/167 = 1.5 & 500/333 = 1.5).
In this demo you can mess around with the image dimensions in the css to see how the sizes can be distorted/deformed.
from anythingzoomer.
Thank you for the response! But I still can't solve the problem. I understand what to do to change the size of an image, but if for example I want to put two images on my webpage, both with the zoom effect. But they have different sizes. But they both are called "small img" and "large img" in order to make the jquery works. In the CSS I can only put one size for small and one size for large. I was wondering if there is any chance of calling the second image in a different way so I can put different sizes on the CSS. The HTML should be something like this:
and CSS:
.zoom { width: 500px; }
.small img { width: 250px; height: 167px; }
.large img { width: 500px; height: 333px; background: white; }
But then both image1 and image2 have the same size (250px X 167px when they are small). What if I wanted the image2 to have a different size when it is small?
from anythingzoomer.
Here are two solutions:
-
Use the wrapper ID to target the
small
andlarge
class names#zoom1 .small img { width: 250px; height: 167px; } #zoom1 .large img { width: 500px; height: 333px; background: white; } #zoom2 .small img { width: 300px; height: 200px; } #zoom2 .large img { width: 550px; height: 367px; background: white; }
-
Or, change the
small
andlarge
class names to anything you want using thesmallArea
andlargeArea
parameters when initializing the plugin// zoom1 would default to small & large $('#zoom1').anythingZoomer(); $('#zoom2').anythingZoomer({ smallArea: 'small2', largeArea: 'large2' });
from anythingzoomer.
It worked. Thank you so so much. Greetings,
Lara
from anythingzoomer.
Related Issues (20)
- Large Container Positioning Problem
- div contets HOT 1
- Zoom displays large image only HOT 2
- conflicts with jquery wrapAll() HOT 1
- Hover doesnot work properly when -transform-rotate is done HOT 6
- Using zoom in multiple stacked images for Chrome / Safari HOT 5
- Plugin not showing zoom window when implemented on bootstrap modal HOT 2
- Issue while rotating image. HOT 4
- image map HOT 3
- Is it possible to rotate zoomer automatically on page load HOT 4
- Cloned Image Offset HOT 3
- Responsive Image HOT 4
- Magnifying svgs HOT 8
- Enable/Disable Anything Zoomer HOT 1
- Show coordinates of large image HOT 6
- Make zoomDim configurable in options HOT 1
- Zooming over input/radio elements HOT 8
- How to use dynamic id based this plugin ? HOT 1
- Canvas compatibility ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anythingzoomer.