jQuery iPhone 3gs performance
<p>I have a performance related question; specifically to iPhone 3gs.
I have a jQuery Mobile site that responded well on my friend's iPhone 3gs until a recent change I've made.
Since the change, on the 3gs, the page in question seems to be very slow.....almost unusable.
The page still runs great on a galaxy S2, but after checking the benchmarks for javascript I can see the S2 is able to handle javascript much better so I guess there's no surprise there.
Also the iPhone 4 should not have a problem going off the benchmark figures.</p>

<p>The code I've added is pretty simple.
It just removes the href from 12 buttons on the page and handles click events.
Here's the code:</p>

<pre><code>$(document).ready(function() {
  $('.mybutton').removeAttr("href");

  $('.mybutton').on("click", function(){
    if($(this).hasClass("inactive") || $(this).hasClass("active")) {
      $(this).toggleClass("active inactive");
    }

    // Disable if 1 active button, else inactive
    if($('.active').length == 1) {
      $('.inactive').toggleClass("inactive disabled");
    } else {
      $('.disabled').toggleClass("disabled inactive");
    }
  });

});
</code></pre>

<p>Is there anything I can do to speed up that code for iPhone 3gs?
Should I even be bothered about this phone? Does anyone still use one barring my technologically challenged work colleague? :)</p>
