I would suggest dropping the add-/remove- class stuff entirely in
favor of simply switching out the background image. Try something like
this:
// Attach a click event to every input in the .nav section.
$('div.nav input').click(function(){
// Extract the specific floor plan from the class.
// (Consider using ID's for this instead, since they are unique.)
var fp = $(this).attr('class').substr(4);
// Switch the viewer's background-image attribute.
$('p.viewer').css('background-image', 'url(graphics/' + fp + '.png');
});
HTH,
Jason
On Nov 15, 6:44 pm, bjreed <[EMAIL PROTECTED]> wrote:
> Hello. I am new to JQuery, and I thought I'd try creating a small app
> to learn more. I've hit a problem that I cannot seem to fix. I have
> a right navigation bar with 8 floor plan links. When you click one,
> the accordian menu drops and shows some details (this works great),
> the other thing that is suppose to happen on click is a large image is
> to appear in the left area. You'll see that it works fine at first,
> BUT when you start clicking down the list AND then try and return to
> an earlier click, is when the problem occurs. It seems there is
> problem removing the classes that have already been called.
>
> I know that there is probably an easy solution, but I have not found
> it yet. I'd appreciate any advice. Thanks
>
> You can view it athttp://jquery.pixeltrails.com/
> All the script is on the default.htm source page. Add/Remove class
> script is at the bottom of the source.