All the effects are run by a single JS file which just changes the styling of the elements. If you have any experience in JS and CSS, take a look at the /js/effects.css file. If you look for the various switch statements, those are the sections that control the effect.
Effects follow a simple pattern: the setup switch where the element is prepared — current stylings are saved, specific heights etc are set –, the actual effect which is just a changing of some CSS value in 10 steps either showing or hiding, and the cleanup where the effect is finished and defaults are restored etc.
For example:
(e is the element, i is the element id, _d[i] is an array of variables specific to the i)
This is the setup of the slideup effect:
case 'SlideUp': _d[i]['height'] = $(i).offsetHeight; if (m === 'show') { /*We need an object to be displayed to retrieve height.*/ e.position='absolute'; /*Pull the element out of its default location*/ e.visibility='hidden'; /*Hide the element*/ e.display='block';/*"Display" the hidden element*/ _d[i]['height'] = $(i).offsetHeight; e.visibility=''; /*Show it*/ e.position='relative'; /*Put it back where it was*/ e.height = '0px'; /*shrink it for the effect.*/ } e.overflow="hidden"; break;- Use the following to copy and paste the code.
This is the actual effect:
case 'SlideUp': if ( m === 'hide' ) { e.height = Math.floor( _d[i]['height']*s*-0.1)+'px'; _d[i].step += 1; } else { e.height = Math.floor( _d[i]['height']*(10-s)*0.1)+'px'; _d[i].step -= 1; }break;- Use the following to copy and paste the code.
This is the cleanup:
case 'SlideUp': e.height = _d[i]['height']+'px'; if(window.innerHeight){ /*IE has problems setting height to auto.*/ e.height = 'auto';} e.overflow="visible"; break;
If you have more questions let me know.