Check hidden (v18)

Revision 18 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<section id="foo">
    <div id="nothing"></div>
    <div id="nothing2"></div>
    <div id="parent">
        <div>
            <div id="test">Hello there</div>
        </div>
    </div>
</section>

Setup

var el = document.getElementById("test");

Test runner

Ready to run.

Testing in
TestOps/sec
Offset check
var x = (el.offsetWidth === 0 && el.offsetHeight === 0) 
ready
jQuery visible
var x = $(el).is(':visible')
ready

Revisions

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