Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
CHAPTER 16 REFACTORING THE EXAMPLE: PART II .css({clear: "both", padding: "5px"}); $('<div id=bbox />').appendTo("body").append(total); $('input').change(function(e) { var total = 0; $('input').each(function(index, elem) { total += Number($(elem).val()); }); $('#total').text(total); }); function handleArrowMouse(e) { var propValue = e.type == "mouseenter" ? "-50px 0px" : "0px 0px"; $(this).css("background-position", propValue); } function handleArrowPress(e) { var elemSequence = ["row1", "row2", "row3"]; var visibleRow = $('div.drow:visible'); var visibleRowIndex = jQuery.inArray(visibleRow.attr("id"),elemSequence); var targetRowIndex; if (e.target.id == "left") { targetRowIndex = visibleRowIndex - 1;