Things to Remember

Friday, 12 June 2009

Spry Div Load & Fade script

User Clicks Link 
Main Content Div Fades out
New Content Loaded  Div fades back in. 
requires jah.js, SpryEffects.js
called by : href="javascript:divfader('home.html');"  

jahdivfader.js:
var divfader = function(url){  
linkurl = url;  
var fade = new Spry.Effect.Fade('inhere', {finish: animation_stop, duration: 2000, from: 100, to: 0, toggle:false});  
fade.start();  
}  
 
var animation_stop = function(){  
jah(linkurl,'inhere');  
var fadein = new Spry.Effect.Fade('inhere',{duration: 2000, from: 0, to: 100, toggle:false});
fadein.start();  
}  

ID your div 'inhere'

Labels: , , , , , , ,