ok ok , jQuery Selectors
I’m doing some stuff with jquery, and i need to bind a mouseover event, but in more than one id, and then change the img src of the selected one, so, i use something like that:
$(‘#id_1, #id_2, #id_3’).bind(‘mouseover’, function(){
var name = $(this).attr(“id”);
switch(name)
{
case ‘id_1’:
$(this).attr(“src”, “/imgs/btn_1_on.gif”);
break;
case ‘id_2’:
$(this).attr(“src”, “/imgs/btn_2_on.gif”);
break;
case ‘id_3’:
$(this).attr(“src”, “/imgs/btn_3_on.gif”);
break;
}
});