From our sponsor: Ready to show your plugin skills? Enter the Penpot Plugins Contest (Nov 15-Dec 15) to win cash prizes!
Today we want to share a little zoom tour script with you. Showing a main image initially, we want to be able to zoom into certain parts of the image by clicking on tags, using another image for the closer view. This next step can contain other tags that again allow to show more images. We achieve the “zoom” effect by enlarging the current image and fading in the new one.
The images used in the demos can be found here:
image1: City Crowd
image1_5: Office
image2: Ikea Room
image3_n: Portimão Marina
Background Pattern by http://www.blunia.com/ on http://subtlepatterns.com/
Tiny break: 📬 Want to stay up to date with frontend and trends in web design? Subscribe and get our Collective newsletter twice a tweek.
The HTML Structure
For the HTML structure we will have a main container and each image inside of a div with the class “zt-item”:
<div id="zt-container" class="zt-container"> <div class="zt-item" data-id="zt-item-1"> <img class="zt-current" src="images/image1.jpg" /> <div class="zt-tag" data-dir="1" data-link="zt-item-2" data-zoom="5" data-speed="700" data-delay="50" style="top:138px;left:151px;"></div> <div class="zt-tag" data-dir="1" data-link="zt-item-3" data-zoom="6" data-speed="700" data-delay="50" style="top:253px;left:520px;"></div> </div> <div class="zt-item" data-id="zt-item-2"> <img class="zt-current" src="images/image1_1.jpg" /> <div class="zt-tag zt-tag-back" data-dir="-1" data-link="zt-item-1" data-zoom="5" data-speed="500" data-delay="0"></div> </div> <div class="zt-item" data-id="zt-item-3"> <img class="zt-current" src="images/image2_2.jpg" /> <div class="zt-tag zt-tag-back" data-dir="-1" data-link="zt-item-1" data-zoom="6" data-speed="500" data-delay="0"></div> </div> </div>
<img class="zt-current" src="images/imageX.jpg" />
is the image in each step. The item then have tags with certain attributes.
The data attributes are the following:
- data-dir is either 1 or -1 depending on whether we want to “zoom in” (1) or “zoom back out” (-1)
- data-link will indicate to which item we connect the tag to (based on the data-id we give to each item)
- data-zoom is the factor of zooming. Set very low, the image we zoom into or zoom back to will only enlarge slightly.
- data-speed the animation speed in milliseconds
- data-delay the delay time for the new image to appear
The example structure above has the first initial image (zt-item-1) with two tags that lead to zt-item-2 and zt-item-3. zt-item-2 and zt-item-3 only have the back tag. As you can see, the back tag has another class “zt-tag-back” and a data-dir value of -1.
The position of the tags is defined in the style attribute and you can also add another size for it, too.
Options
The following are the default options:
$('#zt-container').zoomtour({ // if true the tags are rotated depending on their position rotation : true, // zoom out animation easing. Example: easeOutBounce , easeOutBack zoominEasing : '', // zoom out animation easing zoomoutEasing : '' });
We hope you like this little script and find it useful!
Wow, great app. You’re big part of my inspiration
Exclent effect. Very useful for websites
Simple and Awesome!!!
Tweet Like +1 ^_^
This is awesome! I’ve been looking for something like this for a while. I’ll definitely use this in one of my projects.
as usual great work 🙂
Amazing!!!!!
Astounding work!
Fun!
Super!
Yet another awesome post by god of jquery !
Very refreshing and surprising ! Well done 😉
Freakin’ awesome!
Fantastic!
You are unbelievable Mary! Thx for app.
Mary-Lou, tu es la meilleure!
Merci pour tout ce que tu nous donnes.
Muy Bueno, inspiración para muchos.
felicitaciones
Awesome as always..
great effect… nice
Great one – love it!
It would be further enhanced by incorporating captions to the images as well, so for instance, the IKEA room, click on image to display the lamp, and have captions then show (on load or mouse-over) product details, price, weblink etc.
Three words! Your the best!
Thanks for the post, I can see this Jquery coming in pretty useful in the not to distant future! Im sure with a few additions we can have product names titles etc displaying too. Keep up the good work.
Fiiiiiiiiiiixe!!
Really cool, reminds me lately of the movie Limitless… at the beginning of the movie there was a kind of “infinite zoom”
Thanks for this
Awesome ! Definitely good for tours
wek’s!!!
Very good!
Simply great, thanks for a gently share Mary Lou !
For all people: any suggestion for a way to automate-timing the tour- zooming ?
Mind Blowing…..
Gr8 work.. kudos for your concept 🙂
As always great script!
Is it possible to integrate it in a WordPress theme? Some of you has tryed to do this? Thanks
How is this done? Do you have to upload the zoomed images as well to the web design?
Wonderfull!
there is a way to put a link in the image zoomed?
Thank’s!
Fantastic..
Thanks for sharing
nice!
Hi i need this jquery library to my portfolio can u please help me.
http://www.shoebacca.com/finder/gender/Men/type/Shoe/tab/men-shoe
great and excellent job , nice idea and well done ^__^
great stuff, love it.
but when I tried it using Jquery hashchange event plugin by Ben Alman it seems failed to work.
can you help me?
Exelente.
What is the license for this code? GPL?I’d like to add features and modify, but need to know if the result is releasable. Thank you.
Fantastic !!!
I am not able to set horizontally the tag, can help me ?
very nice 🙂
wow.. cool..!!!
Thank you.. 😀
Nice jquery code Mary. Thnkx.
This is superb! I am intending on using this for a school tour. There are so many practical applications for this code, and in my personal opinion it looks better than many of the professional flash tours. Excellent work!
Could you please give me (us) a clue about how the rotations of zt-tag work, I am not able of understanding hence use them properly, and really getting mad, so I ask for any point.
Brilliant piece of code, Thank you!
It does not work good if I have to one photo link on two other pictures
Great!
I love this!!