aboutsummaryrefslogtreecommitdiff
path: root/doc/that_style/js/striped_bg.js
diff options
context:
space:
mode:
Diffstat (limited to 'doc/that_style/js/striped_bg.js')
-rw-r--r--doc/that_style/js/striped_bg.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/that_style/js/striped_bg.js b/doc/that_style/js/striped_bg.js
new file mode 100644
index 00000000..97ae0a8e
--- /dev/null
+++ b/doc/that_style/js/striped_bg.js
@@ -0,0 +1,32 @@
+// Adds extra CSS classes "even" and "odd" to .memberdecls to allow
+// striped backgrounds.
+function MemberDeclsStriper () {
+ var counter = 0;
+
+ this.stripe = function() {
+ $(".memberdecls tbody").children().each(function(i) {
+
+ // reset counter at every heading -> always start with even
+ if ($(this).is(".heading")) {
+ counter = 0;
+ }
+
+ // add extra classes
+ if (counter % 2 == 1) {
+ $(this).addClass("odd");
+ }
+ else {
+ $(this).addClass("even");
+ }
+
+ // advance counter at every separator
+ // this is the only way to reliably detect which table rows belong together
+ if ($(this).is('[class^="separator"]')) {
+ counter++;
+ }
+ });
+ }
+}
+
+// execute the function
+$(document).ready(new MemberDeclsStriper().stripe);