gpt4 book ai didi

jquery - 独立的 div 切换

转载 作者:太空宇宙 更新时间:2023-11-03 19:08:10 25 4
gpt4 key购买 nike

我正在制作类似 Twitter 的导航栏,但我希望该栏内的一个 div 向下滚动通知或新闻,而其他栏内容保持“原样”。有什么建议吗? http://jsfiddle.net/fdezluis96/JJ29E/

#navigation{
position:fixed;
top:0;
left:0;
width:100%;
padding:5px;
color: #fff;
height:32px;
font-size:20px;
background: #333;
}​

这是主要的 HTML 代码

<div id="navigation">This is the main div static content
<div id="subnavigation">This is the scrolling content.</div>
</div>​

谢谢!

最佳答案

对于 live-pin.com 网站,这似乎可行:

<!-->Add "position: relative;" to have a non-statically position parent.</-->
<div class="nav-collapse" style="position: relative;">

<!-->Change inline styles from "background:#fff; width:300px; overflow:auto;" to "background: #fff; border: 1px solid #fff; border-top-width:0px; border-bottom-width:0px; background: #666; border-radius: 5px; border-top-right-radius: 0px; border-top-left-radius: 0px; position: absolute; max-width: 300px;" (mostly from the fiddle, but "position: absolute" to keep it where it is and remove it from the normal document flow; removing it from the document flow is what allows it to escape its parent's containment.) </-->
<li id="notificationss" style="background: #fff; border: 1px solid #fff; border-top-width:0px; border-bottom-width:0px; background: #666; border-radius: 5px; border-top-right-radius: 0px; border-top-left-radius: 0px; position: absolute; max-width: 300px;">
dssdadsadas
<br>dsadsasdadssdadsadas
<br>dsadsasdadssdadsadas
<br>dsadsasdadssdadsadas
<br>dsadsasdadssdadsadas
<br>dsadsasdadssdadsadas
<br>dsadsasda
</li>

关于jquery - 独立的 div 切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9440354/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com