You can use this jQuery snippet to check if element is hidden or not. This works with elements with display property where display: none;  will return true.

<script>
    jQuery(function($) {
        var elem = $('selector');

        if(elem.is(':hidden')) {
            //the element is hidden. Your code here
        }
    });
</script>