CSS Opacity vs Show

Benchmark created on


Description

Testing perfromance of .css('opacity', '1') vs .show()

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<style>
.display{
display: none;
}
.opacity{
opacity: 0;
}
</style>
<div class="display">Some text</div>
<div class="opacity">Some text</div>

Test runner

Ready to run.

Testing in
TestOps/sec
Display + Show
jQuery('.display').show();
ready
Opacity + CSS
jQuery('.opacity').css('opacity','1');
ready

Revisions

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