ios hover

JavaScript performance comparison

Test case created

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div><span>efjrevgerogrm rmvige jgioerng </span></div>
<div>
        <form>
                <input/>       
<button></button>
        </form>
        <a href=""></a>
<a href=""></a>
<a href=""></a>
<a href=""></a><a href=""></a><a href=""></a><a href=""></a><a href=""></a>

</div>
<style>
p:hover{
background:green;
}
div:hover{
background:red;
}
a:hover{
background:gray;
}
</style>

Preparation code output

efjrevgerogrm rmvige jgioerng

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
stylesheet trick
    try
    {
        var ignore = /:hover/;
        for (var i=0; i<document.styleSheets.length; i++)
        {
            var sheet = document.styleSheets[i];
            for (var j=sheet.cssRules.length-1; j>=0; j--)
            {
                var rule = sheet.cssRules[j];
                if (rule.type === CSSRule.STYLE_RULE && ignore.test(rule.selectorText))
                {
                    sheet.deleteRule(j);
                }
            }
        }
    }
    catch(e){}
 
pending…
jq trick
$("body").on('touchstart','a,input,button', function(){
        isScrolling = false;
    }) .on('touchmove','a,input,button', function(e){
        isScrolling = true;
    }).on('touchend','a,input,button', function(e){
        if( !isScrolling )
        {
                this.click();
        }
    });
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment