Is there a way in jQuery to get the element's true opacity? Of course, you can get the opacity of an element with
$element.css('opacity')
but if, say, his parent defined an opacity of 0.5, then the actual opacity of the element is half that determined by its opacity. Does jQuery have a function for this? If not, is there an existing plugin?
If the plugin is missing, can I calculate it myself, iterating over the parents of the elements until I get to the topmost parent, multiplying the CSS opacity at every step? Or is there something that I do not take into account?
source
share