PHP Classes
Icontem

File: js/photoalbum.js


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of andy loftus  >  Photo Album  >  js/photoalbum.js  
File: js/photoalbum.js
Role: Auxiliary data
Content type: text/plain
Description: Javascript to initialize moo.fx objects
Class: Photo Album
Display interactive photo album
 

Contents

Class file image Download
//the main function, call to the effect object
function init(){
	var stretchers = document.getElementsByClassName('stretcher'); //div that stretches
	var toggles = document.getElementsByClassName('tab'); //h3s where I click on

	//accordion effect
	var myAccordion = new fx.Accordion(
		toggles, stretchers, {opacity: true, height: true, duration: 400}
	);

	//hash functions
	var found = false;
	toggles.each(function(h3, i){
		var div = Element.find(h3, 'nextSibling'); //element.find is located in prototype.lite
		if (window.location.href.indexOf(h3.title) > 0) {
			myAccordion.showThisHideOpen(div);
			found = true;
		}
	});
	if (!found) myAccordion.showThisHideOpen(stretchers[0]);
}

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products