[Problem] Removing Accordion Tabs
Hey Everyone
I've been working on an interface for some time, and I am a little bit of a perfectionist... I've tried to resolve this issue but no luck so far, so hoping some of you jQuery Enthusiasts could help me maybe
I have an accordion for emails on the dashboard (or messages if you will) and when you click on a tab it open up to display the message.
In the footer of the content are a few links (Similar to Wordpress's Mark as Spam etc).
Two of these links are 'Mark as Spam' and 'Delete', it should be quite obvious what I am trying to achieve with these links. To cut a long story short, I wish to delete an accordion item from the accordion (Hide in real time, update the DB using Ajax, it will be gone the next time someone visits the page).
It seems though whenever I try to hide an accordion item (Toggler & Div) it breaks the functionality of the accordion itself, only opening up to 1 tab sometimes and then being completely unresponsive.
Is there any way to actually remove accordion togglers from an accordion in real time, without breaking the functionality? I found the accordion function itself somewhat restricting and I had to find odd-workarounds whilst using them.
I've put a lot of effort into this interface so far so I don't wish to have to recreate everything manually, so hopefully there will be a way.
Here is a snippet
-
$('a.spam').bind("click", function(e){
// Identify the Message Area
var emailMessage = $(this).parent().parent().parent().find("#email_message");
// Change the background colour
emailMessage.animate({
'backgroundColor' : '#412121'
});
// Slide the tab away
emailMessage.parent().parent().slideUp(500);
});
Thanks
Stephen[/code]