I have an interesting problem... I'm trying to make a table which only shows 3 columns at a time, and via the use of left and right arrows can hide the two right columns and show 2 more of the hidden columns, effectively rolling through columns on the right.
I've been successful in achieving this here: http://reach4urphone.com/player/weapons?gamertag=kit001 (FYI: this code isn't used at this link anymore, I went for more compatible, cross-browser solution).
The problem is, although this works in the latest versions of Chrome, IE9 and Safari, it doesn't work on my iPhone4 or iPad2 (my main target platforms). So i'm thinking there is perhaps a jQuery or mobile Safari bug not supporting part of my implementation. Here is my only JQuery code (note that I'm using jQuery UI Tabs in the first line, each of which has a table on its panel):
$(document).ready(function () { $("#tabs").tabs(); });
$('#rightArrow').live('click', function () {
var curr = $(this).closest('table').find('.selected');
var next = curr.next().next();
if (next.length === 0)
next = curr.siblings(':first-child').next();
curr.hide().removeClass('selected').next().hide();
next.show().addClass('selected').next().show();
});
$('#leftArrow').live('click', function () {
var curr = $(this).closest('table').find('.selected');
var prev = curr.prev().prev();
if (prev.length === 0)
prev = curr.siblings(':last-child').prev();
curr.hide().removeClass('selected').next().hide();
prev.show().addClass('selected').next().show();
});
Thanks All.