好的,我正在尝试创建一个 script.js 来制作图像按钮,但代码不想运行!你能告诉我有什么问题吗?
HTML:
<div class="baixo-tudo">
<div class="botao">
<img src="./images/bto-net-out.png" />
<span class="src1">http://www.midnightbsd.org/art/logo/MidnightBSDLogo32x32.png</span>
<span class="src2">http://www.parmaja.com/projects/firebirdlogo/logo-32x32.png</span>
</div>
<div class="botao">
<img src="./images/bto-net-out.png" />
<span class="src1">./images/bto-visual-out.png</span>
<span class="src2">./images/bto-visual-over.png</span>
</div>
<div class="botao">
<img src="./images/bto-net-out.png" />
<span class="src1">./images/bto-sql-out.png</span>
<span class="src2">./images/bto-sql-over.png</span>
</div>
</div>
</div>
脚本.js:
$('.baixo-tudo').find('.botao').each(function (i) {
var imge = $('img');
var t = $('.botao'),
src1 = t.find('.src1').text(),
src2 = t.find('.src2').text();
imge.mouseover(function () {
t.attr('src', src1);
}, function () {
t.attr('src', src2);
});
});
看:http: //jsfiddle.net/NnUe6/
许多神经元发射来创建这个 =/
现在看,图像消失了:http: //jsfiddle.net/NnUe6/4/