当前位置:网站首页>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
边栏推荐
- [ANSYS] learning experience of APDL finite element analysis
- 2、 Concurrent and test notes youth training camp notes
- 聊聊异步编程的 7 种实现方式
- [cloud native] how to give full play to memory advantage of memory database
- 242. Bipartite graph determination
- Redis data migration
- vus. Precautions for SSR requesting data in asyndata function
- Tumor immunotherapy research prosci Lag3 antibody solution
- 一、Go知识查缺补漏+实战课程笔记 | 青训营笔记
- Stockage et pratique des données en langage C (haut niveau)
猜你喜欢

Wechat applet full stack development practice Chapter 3 Introduction and use of APIs commonly used in wechat applet development -- 3.10 tabbar component (I) how to open and use the default tabbar comp

Redis data migration

MobaXterm

Advanced level of C language (high level) pointer

How to * * labelimg

Le Service MySQL manque dans le service informatique

Bi she - college student part-time platform system based on SSM

外包干了四年,废了...

Convolutional neural network -- understanding of pooling

How can a 35 year old programmer build a technological moat?
随机推荐
[ANSYS] learning experience of APDL finite element analysis
机器人技术创新与实践旧版本大纲
外包干了三年,废了...
Wechat applet full stack development practice Chapter 3 Introduction and use of APIs commonly used in wechat applet development -- 3.10 tabbar component (I) how to open and use the default tabbar comp
Tianqing sends instructions to bypass the secondary verification
Wechat applet full stack development practice Chapter 3 Introduction and use of APIs commonly used in wechat applet development -- 3.9 introduction to network interface (IX) extending the request3 met
The metauniverse of the platofarm farm continues to expand, with Dao governance as the core
Make a bat file for cleaning system garbage
L'externalisation a duré trois ans.
2022-07-06:以下go语言代码是否会panic?A:会;B:不会。 package main import “C“ func main() { var ch chan struct
ASEMI整流桥RS210参数,RS210规格,RS210封装
After 95, the CV engineer posted the payroll and made up this. It's really fragrant
resource 创建包方式
今日现货白银操作建议
MySQL service is missing from computer service
Outsourcing for four years, abandoned
聊聊异步编程的 7 种实现方式
Flutter riverpod is comprehensively and deeply analyzed. Why is it officially recommended?
My ideal software tester development status
242. Bipartite graph determination