Change image using jQuery
Posted
by alex
on Stack Overflow
See other posts from Stack Overflow
or by alex
Published on 2010-04-29T13:37:25Z
Indexed on
2010/04/29
13:47 UTC
Read the original article
Hit count: 356
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 */
}
});
});
© Stack Overflow or respective owner