jquery toggle()进行图片切换,该怎么解
$(function(){$("img").toggle(function(){$(this).attr({"src":"images/fj2.jpg","title":...
$(function () {
$("img").toggle(
function () { $(this).attr({ "src": "images/fj2.jpg", "title": "图2" }); },
function () {
$(this).attr({ "src": "images/fj1.jpg", "title": "图1" });
});
});
<img src="images/fj1.jpg" title="图1" /> 展开
$("img").toggle(
function () { $(this).attr({ "src": "images/fj2.jpg", "title": "图2" }); },
function () {
$(this).attr({ "src": "images/fj1.jpg", "title": "图1" });
});
});
<img src="images/fj1.jpg" title="图1" /> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询