2018-07-30帖子的隐藏弹框

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style>
*{margin: 0; padding: 0; font-family: "Arial", "微软雅黑";}
ul,li{list-style: none;}
.bbs{margin: 0 auto; width: 600px; position: relative;}
header{padding: 5px 0; border-bottom: 1px solid #cecece;}
header span{display:inline-block; width: 220px; height: 50px; color: #fff; background: #009966; font-size: 18px; font-weight: bold; text-align: center;line-height: 50px; border-radius: 8px; cursor: pointer;}
.post{position: absolute; background: #ffffff; border: 1px #cccccc solid; width: 500px; left: 65px; top:70px; padding: 10px; font-size: 14px; z-index: 999999; display: none;}
.post .title{width: 450px; height:30px; line-height: 30px; display: block; border: 1px #cecece solid; margin-bottom: 10px;}
.post select{width: 200px; height: 30px;}
.post .content{width: 450px; height: 200px; display: block; margin: 10px 0;border: 1px #cecece solid;}
.post .btn{width: 160px; height: 35px; color: #fff; background: #009966; border: none; font-size: 14px; font-weight: bold; text-align: center; line-height: 35px; border-radius: 8px; cursor: pointer;}

    .bbs section ul li{padding: 10px 0; border-bottom: 1px #999999 dashed; overflow: hidden;}
    .bbs section ul li div{float: left; width: 60px; margin-right: 10px;}
    .bbs section ul li div img{ border-radius:50%; width: 60px;}
    .bbs section ul li h1{float: left; width: 520px; font-size: 16px; line-height: 35px;}
    .bbs section ul li p{color: #666666; line-height: 25px; font-size: 12px; }
    .bbs section ul li p span{padding-right:20px;}
</style>

</head>
<body>
<div class="bbs">
<header><span onclick="openPost()">我要发帖</span></header>
<section>
<ul>
</ul>
</section>
<div id="post" class="post">
<input class="title" placeholder="请输入标题(1-50个字符)">
所属版块:
<select>
<option>请选择版块</option>
<option>电子书籍</option>
<option>新课来了</option>
<option>新手报到</option>
<option>职业规划</option>
</select>
<textarea class="content"></textarea>
<input class="btn" value="发布" onclick="sendTie()">   <input class="btn" value="关闭" onclick="closePost()">
</div>
</div>
<script>

function openPost(){
    var postWindow = document.getElementById("post");
    postWindow.style.display = "block";
}
/**
 * 关闭发帖窗口
 */
function closePost(){
    var postWindow = document.getElementById("post");
    postWindow.style.display = "none";
}

/**
 * 发帖
 */
function sendTie(){
    var ul = document.getElementsByTagName("ul")[0];

    var li = document.createElement("li"); //<li></li>
    var h3 = document.createElement("h3");
    var text = document.createTextNode("新同学 版块:新手报到发表时间:2018-7-30 10:46");
    h3.appendChild(text);
    li.appendChild(h3);

    ul.appendChild(li);

    closePost();
}

</script>
</body>
</html>

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 不会用代码框,所以看着有些乱套,,,,html部分 <!DOCTYPE html> 迅雷看看 ...
    这就是个帅气的名字阅读 1,564评论 0 0
  • 第一部分 HTML&CSS整理答案 1. 什么是HTML5? 答:HTML5是最新的HTML标准。 注意:讲述HT...
    kismetajun阅读 27,758评论 1 45
  • 1、垂直对齐 如果你用CSS,则你会有困惑:我该怎么垂直对齐容器中的元素?现在,利用CSS3的Transform,...
    kiddings阅读 3,207评论 0 11
  • 这篇文字里我会介绍50 个便于使用的 CSS2/CSS3 代码片段给所有的WEB专业人员. 选择IDE开发环境来存...
    JamHsiao_aaa4阅读 1,288评论 0 3
  • “妈妈,语文默写我做了6页啊!数学做几页?”你在那像个小公鸡似的叫喊道,“数学做6页吧”,我边敲打键盘边回道,“...
    HannaG阅读 185评论 0 2