当前位置:网站首页>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
边栏推荐
- IO流 file
- 面试官:你都了解哪些开发模型?
- 計算機服務中缺失MySQL服務
- 解决:Could NOT find KF5 (missing: CoreAddons DBusAddons DocTools XmlGui)
- 外包幹了三年,廢了...
- Make a bat file for cleaning system garbage
- Fullgc problem analysis and solution summary
- 【Liunx】进程控制和父子进程
- 1140_ SiCp learning notes_ Use Newton's method to solve the square root
- 1089: highest order of factorial
猜你喜欢
![[ANSYS] learning experience of APDL finite element analysis](/img/bc/dc0742c308816553a80d50d1a990e3.jpg)
[ANSYS] learning experience of APDL finite element analysis

Talk about seven ways to realize asynchronous programming

毕设-基于SSM大学生兼职平台系统

ROS2规划系统plansys2简单的例子

Jenkins远程构建项目超时的问题

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

How can a 35 year old programmer build a technological moat?

Stockage et pratique des données en langage C (haut niveau)

Bindingexception exception (error reporting) processing

About binary cannot express decimals accurately
随机推荐
What is the difference between TCP and UDP?
2022-07-06:以下go语言代码是否会panic?A:会;B:不会。 package main import “C“ func main() { var ch chan struct
UWB learning 1
为什么要了解现货黄金走势?
1141_ SiCp learning notes_ Functions abstracted as black boxes
Abnova immunohistochemical service solution
面试结束后,被面试官在朋友圈吐槽了......
Software acceptance test
Flutter riverpod is comprehensively and deeply analyzed. Why is it officially recommended?
深度学习花书+机器学习西瓜书电子版我找到了
4、 High performance go language release optimization and landing practice youth training camp notes
How do I get the last part of a string- How to get the last part of a string?
按键精灵采集学习-矿药采集及跑图
Stockage et pratique des données en langage C (haut niveau)
Robot technology innovation and practice old version outline
Leetcode-543. Diameter of Binary Tree
Tumor immunotherapy research prosci Lag3 antibody solution
Why is the row of SQL_ The ranking returned by number is 1
基于Flask搭建个人网站
Interviewer: what development models do you know?