jquery – 如何在SO中显示“first first here”栏并将其他DIV向下滑动?

我实现了代码显示stackoverflow屏幕顶部的栏: How to show popup message like in stackoverflow

这样做是在页面顶部的div顶部显示div.如何显示新的“bar”div并推送其他div?就像StackOverflow一样.

解决方法

编辑:下面对我的代码的立即反应将是不使用div #removeme标记,而是提供一个margin-bottom.但是,如果你要使用position:fixed,那么它将不起作用,因为它将自身附加到窗口而不是文档.

这就是我做的:

在我的HTML文档中:

<div id="removeme">
    <br /><br />
</div>

<div id="header"> This is a floating pane! </div>
<div id="content"> Your content goes here... </div>

此浮动窗格的CSS为:

#header {
   position: fixed;
   top: 0px;
   left: 0px;
   text-align: center;
   background-color: #FFE6BF;
   height: 30px;
   border: 1px solid #FFCFA6;
   width: 100%;
  }

然后在< head>中使用jquery标签

$(document).ready(function() {
 $('#header').click(function() {
  $('#header').slideUp('fast');
  $('#removeme').remove();
 });
});

我有一个额外的< div>当浮动窗格可见时,使用id removeme标记向下推送内容,并在隐藏浮动窗格时将其删除.

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...