I'm just starting out with jquery and am having problems with getting the results I want. In my example I am starting out with a table that has seven rows. When the user clicks on a row I am hiding six rows and showing the row that was clicked on. I want to creata a "next" and "previous" button that either selects the appropriate row up or down. I can get the click function to select a hidden row but it's giving me two rows and not always adjacent. I'm trying to simulate a workflow of going through documents by clicking the next and previous button.
Here's a few snippets from my script:
To select the row you want to work on --
$("tr.sd").click(function() {
$(this).siblings("tr").hide();
$(this).siblings("tr.sortheader").show();
$(this).addClass("selectedLine");
var checkBoxes = $(".selectedLine td input");
checkBoxes.attr("checked", !checkBoxes.attr("checked"));
$('#document, #palette').toggle()
});
Button click function script --
$('a.nxt').click(function(){
$('tr:visible').next('tr:hidden').show();
$('tr.selectedLine').removeClass('selectedLine');
});