CSS/JavaScript - 具有overflow:hidden的元素之外的内容

Ale*_*lex 7 javascript css overflow absolute

我有一个容器div元素overflow:hidden.不幸的是,由于网站的制作方式,因此需要此属性.

在这个div中,它是所有网站内容,包括一些工具提示.当您将鼠标悬停在某个链接上时,这些工具提示会与jQuery一起显示.

问题是,由于上面的溢出事件,其中一些工具提示会显示部分隐藏,因为它们位于容器div之外...

有没有办法能够从这个容器内部显示一个特定的元素,即使它超出了它的界限?也许是一个JavaScript解决方案?

html看起来像这样:

<div style="overflow:hidden; position:relative;">

  the main content

  <div style="position:absolute;left:-100px;top:-50px;"> the tooltip thing </div>

</div>
Run Code Online (Sandbox Code Playgroud)

Vai*_*pta 7

试试这个:

<div style="position:relative;">    
  <div style="overflow:hidden; position: relative; width: {any}; height: {any};">the main content<div>    
  <div style="position:absolute;left:-100px;top:-50px;"> the tooltip thing </div>    
</div>
Run Code Online (Sandbox Code Playgroud)

只需将主要内容放在主div内的另一个div中,并提供css以隐藏内容,如果溢出...