//The code works wonderfully for a single fading text section
//This macro is similar to the QOTD macro but doesn't use a slider for
animation
//the only problem is that i get issues if I create more than one fading
text section.
//usage<<Fader list of space delimited text strings which may be "surrounded
by quotes and a duration at the end" 1000>>
//here is the code
//I couldn't use the QOTD because the slider was kept changing the height
and this needs to be at the top of the page.
version.extensions.Fader={major: 0, minor: 1, revision: 1, date: new
Date("Nov 15, 2008")};
config.macros.Fader = {};
config.macros.Fader.displaynumber = 0;
config.macros.Fader.handler=function(place,macroName,params,wikifier,paramstring,tiddler)
{
this.section=createTiddlyElement(place,"div");
this.time = params.pop();
this.params=params;
this.displaynumber=0;
this.tick();
}
config.macros.Fader.tick=function() {
anim.startAnimating(this.fade(false));
this.section.innerHTML = this.params[this.displaynumber++];
anim.startAnimating(this.fade(true));
if (this.displaynumber>this.params.length-1) this.displaynumber=0;
setTimeout("config.macros.Fader.tick()",this.time);
}
config.macros.Fader.fade=function(opening) {
var p = [];
if(opening) {
p.push({style: 'opacity', start: 0, end: 1, template: '%0'});
p.push({style: 'filter', start: 0, end: 100, template:
'alpha(opacity:%0)'});
} else {
p.push({style: 'opacity', start: 1, end: 0, template: '%0'});
p.push({style: 'filter', start: 100, end: 0, template:
'alpha(opacity:%0)'});
}
return new Morpher(this.section,config.animDuration*3,p,null);
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---