Blame doc/that_style/js/striped_bg.js
|
Packit Service |
31306d |
// Adds extra CSS classes "even" and "odd" to .memberdecls to allow
|
|
Packit Service |
31306d |
// striped backgrounds.
|
|
Packit Service |
31306d |
function MemberDeclsStriper () {
|
|
Packit Service |
31306d |
var counter = 0;
|
|
Packit Service |
31306d |
|
|
Packit Service |
31306d |
this.stripe = function() {
|
|
Packit Service |
31306d |
$(".memberdecls tbody").children().each(function(i) {
|
|
Packit Service |
31306d |
|
|
Packit Service |
31306d |
// reset counter at every heading -> always start with even
|
|
Packit Service |
31306d |
if ($(this).is(".heading")) {
|
|
Packit Service |
31306d |
counter = 0;
|
|
Packit Service |
31306d |
}
|
|
Packit Service |
31306d |
|
|
Packit Service |
31306d |
// add extra classes
|
|
Packit Service |
31306d |
if (counter % 2 == 1) {
|
|
Packit Service |
31306d |
$(this).addClass("odd");
|
|
Packit Service |
31306d |
}
|
|
Packit Service |
31306d |
else {
|
|
Packit Service |
31306d |
$(this).addClass("even");
|
|
Packit Service |
31306d |
}
|
|
Packit Service |
31306d |
|
|
Packit Service |
31306d |
// advance counter at every separator
|
|
Packit Service |
31306d |
// this is the only way to reliably detect which table rows belong together
|
|
Packit Service |
31306d |
if ($(this).is('[class^="separator"]')) {
|
|
Packit Service |
31306d |
counter++;
|
|
Packit Service |
31306d |
}
|
|
Packit Service |
31306d |
});
|
|
Packit Service |
31306d |
}
|
|
Packit Service |
31306d |
}
|
|
Packit Service |
31306d |
|
|
Packit Service |
31306d |
// execute the function
|
|
Packit Service |
31306d |
$(document).ready(new MemberDeclsStriper().stripe);
|