当前位置:网站首页>Weibo publishing cases
Weibo publishing cases
2022-07-07 07:38:00 【Nine thresholds】
① Click the Publish button , Dynamically create a small li , Put the contents of the text box and delete button , And add to ul in .
② Click the delete button , You can delete the current microblog message .
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
ul{
list-style: none;
}
.box {
position: relative;
width: 450px;
height: 450px;
margin: 20px auto;
background-color: skyblue;
}
button {
position: absolute;
right: 10px;
top: 50px;
width: 80px;
height: 80px;
border: 0;
font-size: 20px;
}
textarea {
outline: none;
}
li {
padding: 5px 0;
}
</style>
<script src="jquery.min.js"></script>
</head>
<body>
<div class="box" id="weibo">
<textarea name="" class="txt" id="" cols="40" rows="10"></textarea>
<button class="btn"> Release </button>
<div> Message area :</div>
<ul></ul>
</div>
<script>
$(function(){
//1. Click the Publish button , Dynamically create a small li, Put the contents of the text box and delete button , And add to ul in
$(".btn").on("click",function(){
var li = $("<li></li>");
li.html($(".txt").val()+ "<a href='javascript:;'> Delete </a>");
$("ul").prepend(li);
li.slideDown();
$(".txt").val("");
})
//2. Click the delete button , You can delete the current microblog message li
$("ul").on("click","a",function(){
$(this).parent().slideUp(function(){
$(this).remove();
});
})
})
</script>
</body>
</html>
Some codes are reproduced in
https://blog.csdn.net/weixin_58131487/article/details/120946647
边栏推荐
- 242. Bipartite graph determination
- [cloud native] how to give full play to memory advantage of memory database
- Make a bat file for cleaning system garbage
- 深度学习花书+机器学习西瓜书电子版我找到了
- Model application of time series analysis - stock price prediction
- PostgreSQL source code (60) transaction system summary
- JSON introduction and JS parsing JSON
- About binary cannot express decimals accurately
- Leetcode-206. Reverse Linked List
- Talk about seven ways to realize asynchronous programming
猜你喜欢

Advanced practice of C language (high level) pointer

mips uclibc 交叉编译ffmpeg,支持 G711A 编解码

【leetcode】1020. Number of enclaves

leetcode:105. 从前序与中序遍历序列构造二叉树

resource 创建包方式

1141_ SiCp learning notes_ Functions abstracted as black boxes

JSON introduction and JS parsing JSON

MySQL service is missing from computer service

IO流 file

Initial experience of teambiion network disk (Alibaba cloud network disk)
随机推荐
BGP experiment (1)
Detailed explanation of transform origin attribute
C language (high-level) data storage + Practice
Tumor immunotherapy research prosci Lag3 antibody solution
Summary of customer value model (RFM) technology for data analysis
Sqlmap tutorial (IV) practical skills three: bypass the firewall
Outlier detection technology of time series data
Why is the row of SQL_ The ranking returned by number is 1
Write CPU yourself -- Chapter 9 -- learning notes
Jenkins远程构建项目超时的问题
resource 创建包方式
[2022 ACTF]web题目复现
1142_ SiCp learning notes_ Functions and processes created by functions_ Linear recursion and iteration
Blue Bridge Cup Netizen age (violence)
[2022 CISCN]初赛 web题目复现
Role of virtual machine
About binary cannot express decimals accurately
Dynamics CRM server deployment - restore database prompt: the database is in use
1141_ SiCp learning notes_ Functions abstracted as black boxes
L'externalisation a duré trois ans.