fadeOut-VanillaJS-Jquery

JavaScript performance comparison

Test case created by

Preparation code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<input type="text" value="FadeOut" id="obj"/>
    

Preparation code output

<input type="text" value="FadeOut" id="obj"/>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Pure JS
var obj = document.getElementById('obj').style;
obj.opacity = 1;

// Je lance une fonction anonyme directement
(function(){
    if(obj.opacity >= -1){
        obj.opacity -= .11;
        // On rappelle la fonction qui est exécutée tous les 1/40 secondes
        setTimeout(arguments.callee, 40);
    }else{
        obj.display = "none";
    }
})();
pending…
jQuery
$('#obj').fadeOut();
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