jQuery Pageswitch Plugin

This lightweight and easy to use jQuery Pageswitch Plugin allows you to easily add site-animations to your navigation.


Example

Try this links to test jQuery Pageswitch Plugin:

Example #1
Example #2

HTML
<div id="example">
    <a href="index.html">Example #1</a><br />
    <a href="http://www.example.com">Example #2</a><br />
</div>

JavaScript
<script type="text/javascript">
    $(document).ready(function() {	
        $('#example a:eq(0)').pageswitch();			// select the first a-tag and use standard settings for the animation										
        $('#example a:eq(1)').pageswitch({			// select the second a-tag
            url:		'index.html',			// overwrites the a-href
            properties: { marginLeft: -$('body').width() },	// manipulates the margin of the target	
            options: 	{ duration: 1000 }			// sets the duration of animation
        });											
    });       
</script> 

Check out this for an embedded demonstration of the plugin.

Documentation

Allowed settings:

url		// 'default' for <a>-href, use e.g. 'http://www.example.com' to overwrite href with another url
event		// e.g. 'click', 'mouseover', 'mouseenter', 'mouseleave', ..
target 		// name of one or more animation selectors			
properties	// standard jquery animation properties, e.g. { opacity: 0 }
options		// standard jquery animation options, e.g. { duration: 750 }
Implements original .animation-functions for "properties" and "options".


Download:
v1.0 - with examples (ZIP, 3 KB)
v1.0 - only jquery.pageswitch.js (JS, 2 KB)

jQuery Project: http://plugins.jquery.com/project/jquery-pageswitch-plugin/
Google Code Project: http://code.google.com/p/jquery-pageswitch-plugin/
Contact: www.fancydesign.de


© 2010 Christian Pfeiffer - Imprint