javascript - Hide elements inside div from 'elementFromPoint'-function -
i have div icon , string inside of it.
when move mouse above div want div seen 'elementfrompoint' function - how can achieve this?
here code example.
<div id="rightgazeoption_0" class="gazelinkoption"> <i style="outline: 0px none;" class="gazelinkoptionicon fa fa-external-link"></i><span>elementname</span> </div> var myelement = document.elementfrompoint(/*center of div*/);
now 'myelement' either "< >" or "< span >"-element want div - how can send < > , < span > background "elementfrompoint()" sees main div container?
is possible?
get parentnode
:
var myelement = document.elementfrompoint(/*center of div*/).parentnode;
or adaneo suggested, can use closest()
:
var myelement = document.elementfrompoint(/*center of div*/).closest('div')
Comments
Post a Comment