I need to change the width of an image with in a toggled div. The problem is that I have multiple toggles on the page and that all the开发者_高级运维 image width's change when I click on the toggle link and not just the on one within the div that I want
$('.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;
  });
});
$('.guideImage img', this).animate({
Possibly?
Hard to tell without all the code, but I think this might work.
Change
$('.guideImage img').animate(
to
$(this).prev('.guidebox').find('.guideImage img').animate(
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论