accordion control css lost

D

danstanhope

Hi all,

I have an accordion control that is being dynamically created.
Everything is working as it should, however when I open up a pane and
click another link on the page and then navigate back to the page the
accordion control is on, the selected header CSS is on the wrong
pane.

Has anyone experienced and thing like this?

Any help would be appreciated, Thanks!
Dan
 
I

ian.audsley

A common problem with the Accordion. The styles also go wrong when an
async postback happens. This script fixes the styles. It simply loops,
and resets the header style for all un-open panes. It's a bit of a
fudge, but works.

There are various methods to get this to run as required, like
registering it as a start-up script with a script manger, or having it
run on document load. It's probably best to build this script on the
server as you need to set the client id of your accordion in it (i.e.
using myAccodion.ClientID). l'll leave the exact implementation to
you:


var acc = $find("xxxxxx_AccordionExtender");
for (var i = 0; i < acc._panes.length; i++)
{
if (i != acc._selectedIndex)
{
acc.get_Pane(i).header.className = acc._headerCssClass;
}
}

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top