Toggle 1 at a time with Image Changing using JQuery?

This should do it: $("h2. Msg_head"). Click(function() { var head = $(this); var body = head.next(); if (body.Is(":visible")) { head.

Css("backgroundImage", "url(images/expandbutton-close. Gif)"); body.slideDown(); } else { head. Css("backgroundImage", "url(images/expandbutton-open.

Gif)") body.slideUp(); } }); However I tend to recommend not setting CSS style attributes directly. Classes tend to be a cleaner, more flexible solution so add: h2. Msg_body { background-image: url(images/expandbutton-close.

Gif); } h2. Open { background-image: url(images/expandbutton-close. Gif); } and then do: $("h2.

Msg_head"). Click(function() { var head = $(this); var body = head.next(); if (body.Is(":visible")) { head. RemoveClass("open"); body.slideDown(); } else { head.

AddClass("open"); body.slideDown(); } }).

Cletus (great name btw), I tried messing with both of your options and I can't seem to get them to work. What I have now is 2 separate scripts (because I don't know how to combine them). I've uploaded my best guess.

Can you see if it's just a minor tweak to fix it? Thank you for trying! Sensationsskin.Com/site10/treatments/skin-care.

Html – dg. Mar 19 '10 at 16:42.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions