Hi..
So I've used this script like forever already and now after switching
to 1.2.4 it doesn't seem to work. I know the problem is Fx.Style vs
Fx.Tween, but they've got different syntax or something and because
I'm no mootooler, just a designer, I'd appreciate your help converting
this simple script. All it does is making five links smoothly change
font-size in a given div when they're clicked and then store the
chosen setting in a cookie. The original script can be found here:
http://sherwinhermogenes.co.cc/mootools-increase-decrease-font-size/
window.addEvent('domready', function() {
var resize = new Fx.Style('txt', 'font-size', {duration: 500});
$('fontXXLarge').addEvent('click', function() {
resize.start('28,8em');
Cookie.set("font-size", "xxlarge"); //save this for 1
year
})
$('fontXLarge').addEvent('click', function() {
resize.start('21,6em');
Cookie.set("font-size", "xlarge"); //save this for 1
year
})
$('fontLarge').addEvent('click', function() {
resize.start('16,8em');
Cookie.set("font-size", "large"); //save this for 1 year
})
$('fontMedium').addEvent('click', function() {
resize.start('12em');
Cookie.set("font-size", "medium"); //save this for 1
year
})
$('fontSmall').addEvent('click', function() {
resize.start('9,6em');
Cookie.set("font-size", "small"); //save this for 1 year
})
//check for font size cookie
if(Cookie.get("font-size") == "xxlarge"){
resize.set(28,8);
}else if(Cookie.get("font-size") == "xlarge"){
resize.set(21,6);
}else if(Cookie.get("font-size") == "large"){
resize.set(16,8);
}else if(Cookie.get("font-size") == "small"){
resize.set(9,6);
}else{
//do nothing, leave default
}
});
Thanks in advance.
Regards