• HTML/CSS
  • jQuery
  • PHP
  • JS
  • AJAX
  • MySQL
  • Res
  • XSLT
  • Contact Us
  • HTML/CSS
    • Game Development →
      • HTML5 Game Development - Lesson 1
      • HTML5 Game Development - Lesson 2
      • HTML5 Game Development - Lesson 3
      • HTML5 Game Development - Lesson 4
      • HTML5 Game Development - Lesson 5
      • HTML5 Game Development - Lesson 6
    • Menus →
      • CSS3 multilevel menu with transition and animation
      • Marble Style CSS3 Navigation Menu
      • Toggle CSS3 Bottom Navigation Bar
      • Accordian like CSS3 Onclick Vertical Navigation
      • Multilevel CSS3 Metal Navigation with icons
      • Click-action CSS3 Dropdown Menu with jQuery
      • Click action Multi-level CSS3 Dropdown Menu
      • CSS3 Animated Menu
      • CSS3/jQuery crossbrowser Drop-down menu with tabs
      • CSS3 Drop sliding list Menu #6
      • CSS3 Slideout Menu #5
      • CSS3 Dropdown Menu #4
      • CSS3 Dropdown Menu #3
      • CSS3 Dropdown Menu #2
      • Cool CSS3 Dropdown Menu
    • Templates →
      • Robo Splash Page Layout
      • 'Mono' HTML5 CSS3 Single Page Layout
      • HTML5/CSS3 single page layout - Art theme
      • Attractive HTML CSS Anime Theme Website Layout
      • HTML CSS website layout #4 - Gray theme
      • Dark and clean HTML CSS website layout
      • HTML5&CSS3 single page layout - Rock portal
      • E-Store HTML5 CSS3 Single Page Layout
      • Under Water Themed HTML5 & CSS3 single page Layout
      • HTML5 & CSS3 Single Page Web Layout
    • HTML5 tutorials →
      • HTML5 canvas - Custom brush #2 (Bubble brush)
      • HTML5 canvas - Custom brush (BezierCurveBrush)
      • HTML5 Face Builder
      • Pure HTML5 file upload
      • HTML5 image crop tool
      • HTML5 animation - patterns with loops
      • HTML5 3D circle text with shadows
      • HTML5 canvas pixelate effect
      • Animated Moving Clouds using HTML5
      • Animated Fireplace in HTML5
      • 3D Animated Box HTML5 WebGL Photo Slideshow
      • Your Own Paint Program
      • Image Zoomer in HTML5 Canvas
      • Photo Array in WebGL
      • HTML5 Canvas Image Color Picker
      • HTML5 Image Effects App - Adding Horizontal Flip
      • Keyboard Sensitive 3D Twisted Images in WebGl
      • Animated 3D WebGL Demonstration
      • HTML5 Image Effects App - Adding Noise and Invert
      • HTML5 Canvas Image Effects App - Adding Blur
      • Attractive Presentation with HTML5
      • HTML5 Canvas App for Online Image Enhancements
      • Water Ripple effect using HTML5 canvas
      • Animated 3D canvas object in HTML5
    • CSS3 tutorials →
      • Analog Clock with Pure CSS3
      • CSS3 Optical Illusions
      • CSS3 Animated Photo Slider
      • CSS3 Christmas Tree with Snow
      • How to Create a Pure CSS3 Slideshow
      • CSS3 Drop Caps
      • Pure CSS3 Slider
      • Fantastic Animated Buttons using CSS3
      • How to Create a Pure CSS3 Animated Photo Gallery
      • Toggle CSS3 Bottom Navigation Bar
      • How to Generate Runtime Multi-columns with CSS3
      • Multiple backgrounds and Animation with CSS3
  • jQuery
    • Photo album with jQuery Fotorama
    • Photo album with jQuery Chop Slider
    • Cool Background Image Sliding effect with jQuery
    • jQuery Templates - Usage Practice
    • Photo Album with Galleriffic jQuery plugin
    • Fantastic Photo Album with TN3
    • Ajaxy Photo Gallery (jQuery) with Custom Images Sets
    • Rotating Slider with Easing Effects in jQuery
    • Animated jQuery Progressbar Plugin
    • Nice CSS3 Lightbox Gallery
    • Photo Album with Highslide
    • Using Flux Slider jQuery plugin
    • Ajaxy Chained Selects
    • Modern jQuery Pagination for Content
    • Your own jQuery Slider Plugin
    • Attractive Photo Gallery using SmartGallery
    • Animated Photo Gallery using jQuery (Slider Kit)
  • PHP
    • Powerful Chat System
    • Access Control with Bit Masks
    • Own XML/JSON/HTML API with PHP
    • Your Own Ajax Poll System
    • Diary style PHP Guestbook
    • Smooth Curve Graphs with PHP and GD
    • Your Own Commenting System from Scratch
    • Autocomplete with PHP, jQuery, MySQL and XML
    • Your Own 5 Stars Voting System
    • How to use Memcache with PHP
    • How to install APC on Linux
    • How to Use APC Caching with PHP
    • Watermark processing on images using PHP and GD
    • ID3 Tags Reader with PHP
    • Advance Level Login system with Logic captcha
    • Protection and Methodologies of Security Vulnerabilities
    • How to Resize images on Server Side
    • How to Protect any Site from Spam using Akismet
    • Phar - PHP archiving practice
  • JS
    • Fullscreen Javascript Slide navigation
    • Photo Scrambler grid in javascript
    • Photo Slideshow (zoom fading) effect
    • Custom scrollbars - cross-browser solution
    • Flare Lens Effect
    • Own RSS Reader Using Google Feed API
    • Cross-browser Wave Effects
    • Cross-browser Supported Image Skew effect
  • Res
    • ← jQuery plugin roundups
      • December 2011
      • November 2011
      • 10 fresh jQuery Tutorials
      • October 2011
      • September 2011
      • 10 fresh Ajax related jQuery plugins
      • August 2011
      • 10 Oven Fresh jQuery Plugins for UI
      • 10 Most creative jQuery plugins for tables
      • 10 Most Creative jQuery Navigation Plugins
      • 10 fresh jQuery plugins for working with forms and UI
      • 10 superb jQuery plugins for working with images
    • ← HTML5 stuff
      • HTML5 and Games
      • 10 Fresh HTML5 Tutorials
      • Fresh impressing WebGL demonstrations
      • Most impressing HTML5 with WebGL demonstrations
      • 10 Fresh & Impressive HTML5 Canvas (and WebGL) Examples
      • 10 Exceptional Examples of HTML5 Canvas and Applications
    • ← Mobile
      • How to start developing own applications for Android
      • 10 Fresh Android tutorials
      • 10 Attractive Tutorials for Developing iPhone Applications
      • 10 Attractive android tutorials for developers
      • 10 Fresh iPad Apps for Web Designers & Developers
      • 10 Fresh Android Apps for Web Designers & Developers
      • 10 Fresh iPhone Apps for Web Designers & Developers
      • Top 10 iPhone apps for working with graphics
    • 12 Beautifully Creative Flash Websites of 2011
    • Fresh collection of Original Captchas
  • XSLT
    • How to easily make animated forums using XSLT and Ajaxy
  • Contact Us
KEEP IN TOUCH

Jquery CSS Tutorial on Zooming Image

Mar15
2010
15 Comments Written by admin

Jquery CSS Tutorial on how to Zoom Images

Today I will tell you about another one useful tool of JQuery – Zoomimage plugin. It allow to reach different design ideas with images resizing.

Features

  • Preloads images
  • The images can by grouped in galleries
  • Scales the image to fit the viewport
  • Keyboard gallery navigation

As example, we want to animate list of your members or your image gallery.

  • Live Demo
  • download in package

The  HTML

Here are sources of all 5 samples. As you notice – we having simple unordered list, they all quite same, only have different ‘id’ attribute.

<p>
    <a href="images/demo1_1.jpg" title="Seashell" class="example1"><img src="images/th_demo1_1.jpg" alt="Seashell" /></a>
    <a href="images/demo1_2.jpg" title="Chain" class="example1"><img src="images/th_demo1_2.jpg" alt="Chain" /></a>
    <a href="images/demo1_3.jpg" title="Coins" class="example1"><img src="images/th_demo1_3.jpg" alt="Coins" /></a>
    <a href="images/demo1_4.jpg" title="Ice" class="example1"><img src="images/th_demo1_4.jpg" alt="Ice" /></a>
    <a href="images/demo1_5.jpg" title="Grass" class="example1"><img src="images/th_demo1_5.jpg" alt="Grass" /></a>
</p>

<p>
    <a href="images/demo1_1.jpg" title="Seashell" class="example2"><img src="images/th_demo1_1.jpg" alt="Seashell" /></a>
    <a href="images/demo1_2.jpg" title="Chain" class="example2"><img src="images/th_demo1_2.jpg" alt="Chain" /></a>
    <a href="images/demo1_3.jpg" title="Coins" class="example2"><img src="images/th_demo1_3.jpg" alt="Coins" /></a>
    <a href="images/demo1_4.jpg" title="Ice" class="example2"><img src="images/th_demo1_4.jpg" alt="Ice" /></a>
    <a href="images/demo1_5.jpg" title="Grass" class="example2"><img src="images/th_demo1_5.jpg" alt="Grass" /></a>
</p>

<p>
    <a href="images/demo1_1.jpg" title="Seashell" class="example3"><img src="images/th_demo1_1.jpg" alt="Seashell" /></a>
    <a href="images/demo1_2.jpg" title="Chain" class="example3"><img src="images/th_demo1_2.jpg" alt="Chain" /></a>
    <a href="images/demo1_3.jpg" title="Coins" class="example3"><img src="images/th_demo1_3.jpg" alt="Coins" /></a>
    <a href="images/demo1_4.jpg" title="Ice" class="example3"><img src="images/th_demo1_4.jpg" alt="Ice" /></a>
    <a href="images/demo1_5.jpg" title="Grass" class="example3"><img src="images/th_demo1_5.jpg" alt="Grass" /></a>
</p>

Attaching CSS

I attached 2 external CSS files

<link rel="stylesheet" media="screen" type="text/css" href="zoomimage.css" />
<link rel="stylesheet" media="screen" type="text/css" href="custom.css" />

zoomimage.css, custom.css


Adding JQuery

I attached 3 external JS files

<script type="text/javascript" src="eye.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="zoomimage.js"></script>

And here are additional initialization code

<script type="text/javascript">

(function($){
	var initLayout = function() {
		// example 1
		$('a.example1').zoomimage();

		// example 2
		$('a.example2').zoomimage({
			border: 20,
			centered: true,
			hideSource: true
		});

		// example 3
		$('a.example3').zoomimage({
			controlsTrigger: 'mouseover',
			className: 'custom',
			shadow: 40,
			controls: false,
			opacity: 1,
			beforeZoomIn: function(boxID) {
				$('#' + boxID)
					.find('img')
					.css('opacity', 0)
					.animate(
						{'opacity':1},
						{ duration: 600, queue: false }
					);
			},
			beforeZoomOut: function(boxID) {
				$('#' + boxID)
					.find('img')
					.css('opacity', 1)
					.animate(
						{'opacity':0},
						{ duration: 600, queue: false }
					);
			}
		});
	};

	EYE.register(initLayout, 'init');
})(jQuery)

</script>

Step 4. Images and cursors

Also we need several images and cursors for these demos:

        loading
        custom-lr
        loading
        shadow-c
        shadow-lr
        shadow
        zoomimage_next
        zoomimage_prev
        demo1_1
        demo1_2
        demo1_3
        demo1_4
        th_demo1_1
        th_demo1_2
        th_demo1_3
        th_demo1_4

zoomin.cur, zoomout.cur


For developers. Customization.

Sure that it will useful too

Invocation code

All you have to do is to select the elements in a jQuery way and call the plugin.

 $('a.myLinks').zoomimage(options);

Options

A hash of parameters. All parameters are optional.

OpacityfloatThe opacity for the caption and controls. Default: 0.3
borderintegerImage’s border. Default: 0
durationintegerAnimation duration. Default 300
easingstringAnimation easing. Default: linear
preventintegerPixes to move the mouse before the images is dragged (prevents accidental dragging). Default: 14
controlsbooleanWhatever if the controls are displayed (if the image is not part of an library then the controls are not displayed). Default: true
captionbooleanWhatever if the caption is displayed (the caption text is the text from ‘title’ atribute. Default: true
centeredbooleanWhatever if the image should be centered in the viewport or relative to the trigger. Default: false
hideSourcebooleanWhatever to hide source when the image is opened. Default: false
classNamestringCSS class to apply to the image’s box. Default: false
controlsTriggerstring‘focus’ to show caption and controls when the box is focused or ‘mouseover’ to show controls and caption on mouse over. Default: ‘focus’
preloadstring‘click’ to preload the image when the trigger is clicked or ‘load’ to preload the image on document load. Default: ‘click’
onLoadfunctionCallback function triggered when the image was loaded
beforeZoomInfunctionCallback function triggered before the image is zoomed in
onZoomInfunctionCallback function triggered when the image is zooms in
beforeZoomOutfunctionCallback function triggered before the image is zoomed out
onZoomOutfunctionCallback function triggered when the image is zooms out
onFocusfunctionCallback function triggered when the image is focused

Close all images and clear orphans

If you want to close all openend images or clear images without triggers (remvoed from DOM) then you can use ‘zoomimageClear’. The selection for this plugin should always be ‘div.zoomimage’.

$('div.zooimage').zoomimageClear();

Live Demo

download in package

About: admin:
I am web developer with huge experience (in web languages and even in system languages). Also I am the founder of current website (and several another). I like to write blogs about web development/design. Feel free to Follow us on Twitter: tweetmeme_screen_name='AramisGC';
If you Enjoyed our article don't forget to Share the love with your friends.
    Tweet
   
   
Written by: admin on March 15, 2010.

Related Stuff You Will Love!

  1. Image zoom tool – jQuery imageLens
    Image zoom tool – jQuery imageLens
  2. Positioning Backgrounds with Jquery
    Positioning Backgrounds with Jquery
  3. Cool Background Image Sliding effect with jQuery
    Cool Background Image Sliding effect with jQuery
  4. Creating photo gallery using jQuery and VisualLightBox
    Creating photo gallery using jQuery and VisualLightBox
Posted in HTML/CSS, jQuery - Tagged css, html, image, jQuery, tutorial, zoom, zooming image
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail
» Positioning Backgrounds with Jquery

4 Comments

  1. Hermitbiker's GravatarHermitbiker
    March 16, 2010 at 2:54 am | Permalink

    …. another cool jQuery tutorial about making a zooming image plug-in !! Thanks Ayaz for the share !!

  2. SF's GravatarSF
    September 5, 2010 at 11:53 pm | Permalink

    Can also be done with jQuery AJAX-ZOOM Plugin easily :: http://www.ajax-zoom.com

  3. Mark Willam's GravatarMark Willam
    October 21, 2011 at 11:15 am | Permalink

    Very very helpful tutorial.
    Thank you for Sharing!

  4. wugee's Gravatarwugee
    December 26, 2011 at 8:33 am | Permalink

    it’s cool~
    the theme is also cool,
    Also been applied before the theme

1 Trackback

  1. designfloat.com on March 15, 2010 at 4:40 pm
  2. Jquery CSS Tutorial on Zooming Image – Script tutorials » KHMER855.COM on March 16, 2010 at 2:11 pm
  3. Jquery CSS Tutorial on Zooming Image – Script tutorials » WB Tips on March 16, 2010 at 2:58 pm
  4. 145+ Useful Fresh Articles for Designers and Developers | tripwire magazine on March 17, 2010 at 6:04 am
  5. Jquery CSS Tutorial on Zooming Image | Design Newz on March 27, 2010 at 12:47 am
  6. jQuery CSS Tutorial on Zooming Image on November 4, 2010 at 11:43 pm
  7. 20+ Powerful Jquery Tutorials & Snippets | Free themes download, wordpress themes, blogger themes on December 20, 2010 at 11:10 am
  8. Cool and Useful jQuery Image and Content Sliders and Slideshows - Noupe Design Blog on May 23, 2011 at 10:19 am
  9. 60款很酷的 jQuery 幻灯片演示和下载 | Artfans视觉杂志 on May 31, 2011 at 4:49 pm
  10. Jquery slider on June 24, 2011 at 2:08 pm
  11. 190+ Best! jQuery Slider tools – Part IV - Pixel2Pixel Design on July 7, 2011 at 6:31 am

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

CAPTCHA Image
Refresh Image

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Popular Tutorials

  • How to create easy pagination with jQuery
  • Animated jQuery Progressbar Plugin
  • Pure HTML5 file upload
  • Creating a HTML5 & CSS3 Single Page Web Layout
  • 10 fresh jQuery plugins (december 2011)
  • Cool Background Image Sliding effect with jQuery
  • Developing Your First HTML5 Game – Lesson 1
  • How to Create Animated Photo Gallery using jQuery (Slider Kit)

Tags

3d AJAX android animated animation app application applications apps canvas captcha chat system coding creating css css3 developers effect effects flash fresh gallery how-to html html5 image images iphone javascript jQuery layout menu navigation new photo PHP plugin plugins slideshow system tutorial tutorials webgl website xslt

Recent Tutorials

  • CSS3 Image Hover Effects
  • HTML5 Canvas Slideshow
  • HTML5 Game Development – Lesson 7
  • CSS3 Modal Popups
  • Powerful Chat System – Lesson 2
  • Isometric interactive interior guide
  • 15 Unique and Creative Layouts 2011
  • Invoicera offer

Friends

  • X-Musics

Tutorials for Web Developers Copyright © 2009-2011 Script tutorials · All rights reserved