Hi creative couple,
allow me to discuss still a little.
If I cleaned up the very first method like:
function appendTitles() {
var titles = ['title_1','title_2','title_3','title_4'];
$.each(titles, function(index,title){
$('#foldout').append("<img id = "+title+" class='titles' src='images/"+title+".png'></img>")
}
);
}
(it still works ;-)
it would have the advantage to keep the defined array.
My initial idea was to be able to change that list on an event elsewhere embedding as a global variable later on.
How would you do this instead?
By the way (to make it a little more difficult ;-)
I did one of my usual overkills by adding this animation to it:
$("#menu div:first")
.hoverIntent(function(){
var currTitle = $("#gwork").val();
appendTitles();
$('#foldout img')
.not('#title_'+currTitle)
.each(folder);
},function(){
$('#foldout img')
.stop(true.true)
.animate({'opacity': 0,'top': '0px','margin-top': '0px'}, 600, 'easeOutSine',function(){
$(this).stop(true.true)
.css('position', 'absolute');})
});
with „each(folder) [I think you wrote that code if I don’t go wrong]
function folder(index) {
var times = [1500,600,240];
if (times[index]) {
$(this) .stop(true, true)
.css('position', 'relative')
.animate({'opacity': 1,'top': '-132px','margin-top': '17px'},times[index],'easeOutSine');
}
}
So I guess my next task would be to gether all this stuff in an overall function that could be turned on and off by an event elsewhere.
Am I going too far?
:-)
Garavani
PS: I changed all my IDs