Fixed checking for darkening effect

If z-index was set to 'auto' then checking didn't
work properly