0

iPad をクラッシュさせる小さなコードの塊があります。テストした他のすべてのブラウザー (Chrome、Firefox、Internet Explorer 7 以降) で問題なく動作します。しかし、私のiPadで失敗した場合。

var isiPad = navigator.userAgent.match(/iPad/i) != null;

$('li .staffPicker').each(function() {
    if(count == randomStaff){
        $(this).addClass('staffPickHover');
        $('.staffChoice').html(staffPickDisplay[randomStaff]);
        orientation = adjustStaffPickSize('.staffPickPhoto img');

        if (!isiPad){ 
            **$('.staffPickPhoto img').addClass(orientation);**
        }

        $('.reviewNum').each(function() {
            $(this).hide();
        });
    } 
    count++;
});

私は現在、その人がiPadを使用しているかどうかを確認しており、プログラムが失敗する原因となるコード行をスキップしているだけですが、コード自体を修正したいと考えています. 特に、iPhone では動作しない可能性があり、問題は iOS の異なるバージョンで修正される可能性があることを考慮してください。

問題の Web サイトは www.bookcellarinc.com です。

4

0 に答える 0