Description

The MultiView moodget allows developers to change between views, thus, showing different content.

This plugin is under 3k, so very lightweighted. It's also unobtrusive, for all of those that don't have javascript enabled.

Sample

Just click on the links bellow and give it a try:

show view one show view two

Some content

lorem ipsum content

Html

<div class="triggers">
	<a href="javascript:void(0)" rel="view_one">show view one</a>
	<a href="javascript:void(0)" rel="view_two">show view two</a>
</div>
<div id="multiview">
	<div id="view_one" class="view">
		<h3>Some content</h3>
		<p>lorem ipsum content</p>
	</div>
	<div id="view_two" class="view" style="display:none">
		<h3>Another view</h3>
		<p>lorem ipsum content</p>
		<p>lorem ipsum content</p>
		<p>lorem ipsum content</p>
	</div>
</div>
		

Javascript

var mv;
window.addEvent("load",function(){
	mv = new multiView("multiview");
	mv.setViews("#multiview div.view");
	mv.setTriggers(".triggers a");
	mv.start();
});
		

Css

.view
{
	position:absolute;
	opacity:0;
	filter: alpha(Opacity=0);
	-moz-opacity:0;
	width:100%;
}
		

Roadmap

This is some of the features that I think the MultiView lacks:

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.

Download

Download the latest version of the MultiView for mootools.