「-hover」画像 (ロールオーバー効果) の正確なファイル パス ディレクトリを指定するにはどうすればよいですか? 現在、これは子ディレクトリにある画像に対してのみ機能します。
$(function(){
$('.box-img').append('<span></span>').hover(
function(){
$(this).find('img').stop().animate({opacity:0})
}, function(){
$(this).find('img').stop().animate({opacity:1})
}
).each(function(){
var src=new Array()
src=$(this).find('img').attr('src').split('.')
src=src[0]+'-hover.'+src[1]
$(this).find('>span').css({background:'url('+src+')'})
});
})