1
我需要更改切换div中的图像的宽度。问题是,我有页面中的所有图像宽度的变化上,并且多个切换,当我点击切换链接,不只是一个,我想更改切换宽度的图像
$('.toggle').click(function() {
$(this).prev('.guidebox').slideToggle(400);
$('.toggle').toggleClass("active")
if ($(this).html() === 'less') {
$(this).html('more');
$('.guideImage img').animate({
width: '187px',
height: '124px'
}, 50, function() {
});
} else {
$(this).html('less');
$('.guideImage img').animate({
width: '300px',
height: '124px'
}, 50, function() {
});
}
return false;
});
});
感谢。我不得不使用.parent,因为它在外面,但现在工作:) – kristina