Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery - Can the show() function return true?

Tags:

jquery

I have make a script by using jQuery such as :

$(document).ready(function() {
    $('a[name=pmRead]').click(function(e) {
        e.preventDefault();

        var pmtext=$(this).parents(".pmMain").find(".pmMain5");
    });         
});

Now, I'd like to use a function like pmtext.show() and get TRUE if the element is visible. Else, I'd like to return FALSE. Any change to get TRUE/FALSE by using show()? (or the sister function hide()).

like image 701
markzzz Avatar asked Sep 08 '26 02:09

markzzz


1 Answers

There is a function to check the visibility, but it is not show()/hide().

if (pmtext.is(':visible')) {
    // ....
}
like image 124
Orbling Avatar answered Sep 10 '26 16:09

Orbling