Change image using jQuery
- by alex
I have a html-page where used jquery-ui accordion.
Now I have to add in this page 2 image which should vary depending on the active section.
How can I do it?
HTML:
<div id="acc">
<h1>Something</h1>
<div>Text text text</div>
<h1>Something too</h1>
<div>Text2 text2 text2</div>
</div>
<div id="pic">
<img class="change" src="1.png"/>
<img class="change" src="2.png"/>
</div>
JS:
$(document).ready(function() {
$("#acc").accordion({
change: function(event, ui) {
/* I'm think something need here */
}
});
});