Fork me on GitHub

jQuery

Zoomooz.js

Version 0.70 (Aug 23, 2010, support for non-body zoom root)
Zoomooz is an easy-to-use jQuery plugin for making any web page element zoom.
Download Zoomooz.js (zip)

Examples

Flickr image stack Isometric cube SVG Tree demo Fixed element demo

Enabling the library

Put the following in the head-section of your page:

<link rel="stylesheet" href="style/zoomooz.css" type="text/css" />
<script type="text/javascript" src="js/sylvester.js"></script>
<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="js/jquery.zoomooz.js"></script>

Adding zoom effect

This adds a simple zoom on clicking to elements with class "zoomTarget". The zoom can be reset by clicking the body.

<script type="text/javascript" language="javascript">
  $(document).ready(function() 
    $(".zoomTarget").click(function(evt) {
      $(this).zoomTo();
      evt.stopPropagation();
    });
    $("body").click(function(evt) {
      $(this).zoomTo({targetsize:1.0});
      evt.stopPropagation();
    });
  });
</script>

Browser support

Supported browsers:

Safari Chrome Firefox Firefox

No IE support, sorry.

Detailed settings

settings = {
	// zoomed size relative to screen
	// 0.0-1.0
	targetsize: 0.9,
	// scale content to screen based on their size
	// "width"|"height"|"both"
	scalemode: "both",
	// animation duration
	duration: 1000,
	// easing of animation, similar to css transition params
	// "linear"|"ease"|"ease-in"|"ease-out"|
	// "ease-in-out"|[p1,p2,p3,p4]
	// [p1, p2, p3, p4] refer to cubic-bezier curve params
	easing: "ease",
	// use browser native animation in webkit
	// true|false
	nativeanimation: true
}
$(this).zoomTo(settings);

Bugs and issues

Feature ideas