Toggle 1 <div> at a time with Image Changing using JQuery
Posted
by dg
on Stack Overflow
See other posts from Stack Overflow
or by dg
Published on 2010-03-19T01:10:48Z
Indexed on
2010/03/19
1:11 UTC
Read the original article
Hit count: 286
Please see this site: http://www.sensationsskin.com/site10/treatments/skin-care.html
I've got it working, but am wanting the "+" to change to the "-" (expandbutton-close.gif). I'm using CSS right now to pull up the image, but I think I need to incorporate it into the JQuery code?
<script type="text/javascript">
$(document).ready(function(){
//hide the all of the element with class msg_body
$(".msg_body").hide();
//toggle the componenet with class msg_body
$(".msg_head").click(function(){
if ( $(this).next(".msg_body").is(':visible') ) {
$(".msg_body").hide();
} else {
$(".msg_body").hide();
$(this).next(".msg_body").slideToggle(450);
}
});
});
</script>
© Stack Overflow or respective owner