i have a function that i want to start with different handlers. but i can't get it right.
first i did have all the functions in separated lines.
$("#title_album").mouseup(function(){ menu_changer("_album") });
$("#title_animals").mouseup(function(){ menu_changer("_animals") });
$("#title_date").mouseup(function(){ menu_changer("_date") });
$("#title_nature").mouseup(function(){ menu_changer("_nature") });
$("#title_people").mouseup(function(){ menu_changer("_people") });
$("#title_place").mouseup(function(){ menu_changer("_place") });
$("#title_settings").mouseup(function(){ menu_changer("_settings") });
$("#title_stillife").mouseup(function(){ menu_changer("_stillife") });
$("#title_urban").mouseup(function(){ menu_changer("_urban") });
i tried to get it in a 'for' loop.
var menu_function_array = ["_album", "_animals", "_date", "_nature", "_people", "_place", "_settings", "_stillife", "_urban"];
for (var i = 0; i < menu_function_array.length; i = i + 1) {
$(menu_function_array[i]).mouseup(function(){ menu_changer(menu_function_array[i]) });
}
now all my buttons do all the the work one the last button in the array.
how can i get this right? Thanks in advance