Wednesday, 28 August 2013

Javascript configuration object advice

Javascript configuration object advice

This isn't a problem code, it's more of an advice question. I found the
below code on Better Practices for Javascript.
If I had this code below, what would be the usage for it the script to
pull labels and settings etc.
carousel = function(){
var config = {
CSS:{
classes:{
current:'current',
scrollContainer:'scroll'
},
IDs:{
maincontainer:'carousel'
}
}
labels:{
previous:'back',
next:'next',
auto:'play'
}
settings:{
amount:5,
skin:'blue',
autoplay:false
}
};
function init(){
};
function scroll(){
};
function highlight(){
};
return {config:config,init:init}
}();

No comments:

Post a Comment