PDA

View Full Version : Jquery Toggle Image Change



spadez
Feb 20th, 2010, 03:58 PM
Hi,

Im using a toggle script on my site. Im trying to add functionality. Currently, when you click on a toggle, that particular toggle expands and changes the toggle image.

Ive made it so when you click the text on the top left, all the toggles open or close. However, the toggle image doesnt change (+ / -)

Here is my code:

$(document).ready(function(){

$(".toggle_container").hide();

$("h2.trigger").toggle(function(){
$(this).addClass("active");
}, function () {
$(this).removeClass("active");
});

$("h2.trigger").click(function(){
$(this).next(".toggle_container").slideToggle("slow,");
});


$("h2.trigger2").toggle(function(){
$(".toggle_container").slideDown();
}, function () {
$(".toggle_container").slideUp();
});

});

Here is my site: http://www.zombiemod.com/sm/test6.html

Just to explain it better. When you click on the center toggles, the background image changes. When you click on "Web Design and Development" on the left, the background images dont change. Im trying to get it so it changes as well.

Can anyone help with this?