Update `visible` method

I added style check.
the change on master is to first check that `elem` exists, if it doesn't, return `false`... let's include that improvement here too :)