> i get issues if I create more than one fading text section
Try this:
http://tiddlywiki.pastebin.com/f505bf217
(Code's also attached below, just in case... )
I've simply created an instance object that I'm passing around.
HTH.
-- F.
---------------
//{{{
version.extensions.Fader = { major: 0, minor: 1, revision: 2, date: new
Date("Dec 5, 2008") };
config.macros.Fader = {};
(function(macro) { //# set up alias
macro.displaynumber = 0;
macro.handler = function(place, macroName, params, wikifier,
paramstring, tiddler) {
this.tick({
section: createTiddlyElement(place, "div"),
time: params.pop(),
params: params,
displaynumber: 0
});
};
macro.tick = function(instance) {
anim.startAnimating(macro.fade(instance, false));
instance.section.innerHTML = instance.params[instance.displaynumber++];
anim.startAnimating(macro.fade(instance, true));
if(instance.displaynumber > instance.params.length - 1) {
instance.displaynumber = 0;
}
setTimeout(function() { macro.tick(instance); }, instance.time);
};
macro.fade = function(instance, 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(instance.section, config.animDuration * 3, p, null);
};
})(config.macros.Fader); //# end of alias
//}}}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---