Home
Image Effects
Here
|
Categories
Other Sections
Sweet Ads
Compatibility
|
|
FF1+ IE6+ Opr9+
Simple Image Panner and Zoomer v1.1 Author:
March 25th, 10': Updated with ability to zoom in/out of image Description: Simple Image Panner lets you partially clip and confine large images on your site to a smaller container to save space, with the hidden portion accessible by dragging -or panning- inside the image. The optional zoom feature lets the user zoom in and out of the image at the same time. This script is great for embedding large images on your page that users may also want to zoom in on to get a closer look. Demos (Drag inside image to see more. First and 2nd image zoomable as well):
Step 1: Add the below code inside the <HEAD> section of the page: The above code references an .js external file plus two images which you should download below (right click, and select "Save As"):
Step 2: Insert the below sample code into the BODY section of your page, which adds 1 pannable image: To make an image pannable, wrap the image inside a DIV with
CSS class=" <div class="pancontainer"
data-orient="center" style="width:400px; height:300px;"> You should:
Inside your DIV tag, you can also insert the following two optional attributes to fine tune the behaviour of the Pannable Image in question. They are:
The following code creates a pannable image that's also zoomable: <div class="pancontainer"
data-orient="center" data-canzoom="yes" style="width:700px; height:500px;"> Some things to ConsiderSince each pannable image is encased inside a DIV, things like
centering the image or displaying two pannable images side by side for example
requires a little more work. To center the image on the page, you may use the
CSS technique <div class="pancontainer"
data-orient="center" style="width:400px; height:300px; margin:auto"> To display two pannable images side by side, floating each DIV will suffice in most cases: <div class="pancontainer"
data-orient="center" style="width:400px; height:300px; float:left"> |