I want to change the image inside class="slide" when its toggled.
There are several widgets like this so relevant widget image must be changed.
<div class="widget">
<h3>Inhaltsverzeichnis</h3>
<div class="widgetbox">
<ul>
<li><a href="#"> Prozessbeschreibung</a></li>
<li><a href="#">Produkte & Dienstleistung </a></li>
<li class="active"><a href="#">Beschaffen</a></li>
<li><a href="#"> Prozess-Steckbrief</a></li>
<li><a href="#"> Beschreibung</a></li>
<li><a href="#"> Mitgeltende Dokumente</a></li>
<li><a href="#"> Korrekturhinweise</a></li>
<li><a href="#"> Optimierungsvorschläge</a></li>
<li><a href="#"> Prozessübersicht</a></li>
</ul>
</div>
<div class="slide"><img src="img/slideup.png" width="16" height="15" alt=""/</div>
</div>
currently Js is
$(".slide").click(function(){
$(this).prev().children().slideToggle("slow", function() {
});
});
now how can i change the img slideup.png to slidedown.png when the ul is hidden , the following works but it replaces all images from all widgets.
if ($('div.widgetbox>ul').css("display")=="none") {
$(".slide>a>img").attr("src", "img/slidedown.png");
}
else{
$(".slide>a>img").attr("src", "img/slideup.png");
}