1, 0 fadeIn fadeOut:
$("#"+idnum+"").animate( { opacity:1 }, 800 );
$("#"+idnum+"").animate( { opacity:0 }, 500 );
, .
...
-, . , , .
:
var id = new Array;
id = $(this).attr('class').split(' ');
new Array, . , :
var ids = $(this).attr('class').split(' ');
:
for (var i in id) {
"for..in" . , - Array.prototype . , jQuery $.each().
:
if(ids[i].match('box-interactive.+')){
var idnum = 'bandeau'+id[i].substring(15);
...
.match , , .substring(15):
var match = ids[i].match( /box-interactive(.+)/ );
if( match ) {
var idnum = 'bandeau' + match[1];
...
, , jQuery ? - . JavaScript :
$(function(){
$("div[class^='box-interactive']").hover(
function(){
$(this).find('.bandeau').animate( { opacity:1 }, 800 );
},
function(){
$(this).find('.bandeau').animate( { opacity:0 }, 500 );
}
);
});
( , . , .)