google maps infobox above all other content z-index does not work

廉价感情. 提交于 2019-12-18 09:34:21

问题


I use infobox to attach a div to about 20 markers on a map. The div contains a anchor that shows up via classname:hover. This works as expected but alas: I really would like to have the box, that pops up at :hover to trump all other content on the page in order to make sure, the content of the box is not behind anything else.

I have applied position and z-index to all relevant elements on the page and the popup boxes have z-index 1000 while all other are below 100. Still the marker-image (z-index 80) covers the box. I tried to change panes and have set the index for the marker by using setZIndex to 80 but to no avail.

boxText.innerHTML = '<p class=\"sheikh_flag\"> <a   style=\"z-index:1000\" class=\"sheikh\" href=\"index.php\"> Linktext  </a>  Text   </p>';

Is there a way to make sure, that anchor class sheikh is always displayed atop all others?


回答1:


Z-index only works with elements that have position: relative / absolute / fixed



来源:https://stackoverflow.com/questions/18441680/google-maps-infobox-above-all-other-content-z-index-does-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!