JS实现简易留言板增删功能
本文实例为大家分享了JS实现留言板增删功能的具体代码,供大家参考,具体内容如下
##**JS实现简易留言板的增删功能**
一个很简单的留言板,实现**增删**功能,因为没有数据库,所以只是一个静态的留言板功能。
**修改**功能其实也可以添加,但是我现在技术不够,等以后可能会添加**修改**功能。
代码很简单,注释很清楚。```
Document *{ margin:0; padding:0; list-style:none; } .cle:after{ height:0; clear:both; visibility:hidden; display:none; content:""; } .bbslist{ width:400px; margin:10pxauto; border-radius:5px; background:#A6A6A6; border:1pxsolid#a6a6a6; } .bbslist>ul{ margin:8px10px10px10px; display:block; clear:both; text-align:center; box-shadow:3px3px25px#A6A6A6; } .bbslist>ul>li{ background:#f4f4f4; margin:10px0; line-height:30px; height:30px; border-radius:5px; text-align:center; box-shadow:3px3px17px#A6A6A6; padding:05px; font-size:12px; border:1pxsolid#a6a6a6; position:relative; transition:all0.5s; animation:liBg0.3s; overflow:hidden; } @keyframesliBg{ from{ background:#442222; opacity:0; left:-20px; height:0; } to{ background:#f4f4f4; opacity:1; left:0; height:30px; } } .mesDiv{ width:400px; background:#eee; height:130px; border:1pxsolid#a6a6a6; margin:20pxauto; border-radius:5px; box-shadow:3px3px17px#A6A6A6; animation:msgHeight0.5s; overflow:hidden; } @keyframesmsgHeight{ from{ height:0; margin-top:50px; opacity:0; } to{ height:130px; margin-top:20px; opacity:1; } } .inputSty{ width:90%; height:30px; display:block; color:#666; border:1pxsolid#ddd; padding-left:5px; line-height:30px; font-size:12px; clear:both; margin:10pxauto; border-radius:5px; } .btnSty{ width:30%; height:25px; margin:0auto; display:block; cursor:pointer; transition:all0.2s; border-radius:5px; box-shadow:3px3px10px#A6A6A6; } .btnSty:hover{ width:20%; height:30px; border-radius:5px; box-shadow:3px3px10px#A6A6A6; } .userSty{ width:25%; height:25px; margin:8px18px3px18px; border-radius:5px; box-shadow:3px3px10px#A6A6A6; } .dd{ width:135px; height:10px; position:relative; top:-10px; font-size:8px; float:right; clear:both; } .delbtn{ width:35px; height:22px; border-radius:5px; position:relative; top:5px; right:-4px; float:right; z-index:2; color:red; /*box-shadow:2px2px3px#A6A6A6;*/ }