Finding if element is visible (JavaScript )

前端 未结 4 1515
悲哀的现实
悲哀的现实 2021-02-05 19:44

I have a javascript function that tries to determine whether a div is visible and does various processes with that variable. I am successfully able to swap an elements visibilit

4条回答
  •  春和景丽
    2021-02-05 20:08

    If you would like to do this only javascript way you may try

    window.getComputedStyle(document.getElementById("mydivID"),null).getPropertyValue('display')
    

提交回复
热议问题