Andi
Sun, 22 Jun 2008 11:27:02 -0700
So, finally made it and want to share my "dirty"-hack for toggling flat-structures..
The problem was to toggle any content between to :header tags...
**
* Behandlung der Klicks auf die Überschriften (die Fragen)
* Hinweis:
*/
$( ":header" ).click(
function(){
var $start = $(":header").index($(this));
var $end = $start + 1;
$(":header").eq($start).toggleClass("highlight");
$(":header").eq($start).nextAll().not(":header").toggle();
$(":header").eq($end).nextAll().not(":header").toggle();
//console.log("start:"+$start);
//console.log("end:"+$end);
return false;
}
);
Therefore I take the index for the current headline and toggle ANY
content afterwards and then, this is the "dirty"-thing of it!! toggle
ANY content after the next header one more time....
It would be more efficient to create a DOM first and only toggle
this... If anyone has a hint, so don't hesitate ;)
Greetings
Andi