If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Normally when you click on expandable menu header you have the option (collapseprev) to close other menu header which is opened at this moment. The same situation is with subexpandable headers.
I need to be able to collapse everything else when i click on non expandable header.
For example:

Now script works like this:
1. click on expandable_header_1 - this header expands -> click on expandable_header_2 - this header expands and expandable_header_1 collapse
2. click on subexpandable_header_1_1 - this header expands -> click on subexpandable_header_1_2 - this header expands and subexpandable_header_1_1 collapse
3. click on expandable_header_1 - this header expands ->click on subexpandable_header_1_1 - this header expands ->click on expandable_header_2 - this header expands and expandable_header_1 collapse -> click on expandable_header_1 once more - this header expands and subespandable_header_1_1 is expanded (I want it to be collapsed)

I know I can do this like this: <a href="kontakt.php" data-pjax='rightcolumn' class="menuheader" onClick="ddaccordion.collapseall('expandable'); ddaccordion.collapseall('subexpandable'); return false;" >kontakt</a>

But this way I ned to add onClick manually to every link, which is rather bad idea.
I hope there is easy solution with onopenclose:function(header, index, state, isuseractivated) {}

This script would be great for me if it has working persistance.
And how can I add sub menu to it ?

I am not web develloper I am just making simple website for my wife. It can be seen under http://sk-architekci.pl/sknowy/
I am using pjax to display content in the main window.
I found dirty solution for my problem from first post:

It is working for all browsers wit push sate compability, ofcourse except IE ! hehe
In IE there is a problem because if I click on menu, whole page is reloading and the above script is starting to work, menu is starting to collapse... and the page is reloading. ( open my page click on STRAWBALE >TECHNOLOGIA and then click on LINKI ZEWNETRZNE OR DLA INWESTORA OR KONTAKT - You will see what I mean )

Please help, maybe the solution is very simple or maybe there is some dirty workaround ??