0

Using the mouse or keyboard jQuery UI's Accordion visually moves the "focus" to that header (darkens the border, background, font by default).

Is there an event that I can hook into to know which header is current without the user having to open the panel?

I can somewhat fake this by changing the open event to mouseover and then hooking into activate but that doesn't cover the keyboard and I'd prefer not to have to open the panel.

This seems like it should be obvious but I'm drawing a blank.

Thanks in advance.

Mike Summers
  • 2,139
  • 3
  • 27
  • 57

1 Answers1

0

Not sure if this is what you were looking for. http://api.jqueryui.com/accordion/

There is an active method to get the active tab and then there is activate/beforeactivate event which gives you the required handle.

gvmani
  • 1,580
  • 1
  • 12
  • 20
  • activate/beforeactivate only fire when the panel expands (or is getting ready to expand), not on mouseover or the arrow keys. :-( – Mike Summers Jul 26 '13 at 17:20
  • Again not very sure this will help. But just a suggestion from my side .If the jqueryui is changing it visually, then there should be some change of css classes. You can look out for class changes/select the tab/header with that particular class. http://stackoverflow.com/questions/1950038/jquery-fire-event-if-css-class-changed – gvmani Jul 29 '13 at 08:11
  • Yes, I went that way for a bit. It turned out for reasons related to scrolling I was better off having the selected panel open so I hooked into "activate". Thanks for you thoughts, I appreciate them. – Mike Summers Jul 30 '13 at 16:26