Preface: Since I have been learning some knowledge about Jquery these days, I feel that Jquery is too powerful than before. Many simple functions used to require dozens of lines of code in JavaScript but only use a few lines of code in Jquery. That’s it, so I decided to study Jquery hard. Please support me. Haha, learning Jquey these days has made me feel that it is not difficult to use Jquery. I feel that Jquery only needs to learn the selector. The basics can be easily solved, learn more about some methods, events, etc. So I implemented a Jquery here to imitate Tencent's meager broadcast publishing.
1. First create a new HTML page and introduce what function I want to achieve
(1) Create a new HTML page as follows
(2) The first function, when the mouse slides over the broadcast image, it will turn into another picture with a lighter color, and it will return to the original state when leaving it
(3) The second function is that when you enter text into the text input box and do not enter a word, the number of words indicated at the bottom is reduced by 1. If it exceeds the number, the user will be prompted how many words have been exceeded
(4) The third function is to click the topic button. If the text box is empty, #Please enter topic information # will be entered, and please enter the topic information to highlight. If the text box is not empty, nothing will be displayed. Do not enter
(5) The fourth function is that when a friend is clicked, a layer will be generated underneath to display the user’s friends. When the user clicks a friend, the name will be displayed in the text box
(6) The fifth function, when the user clicks on the emoticon, the commonly used emoticons of QQ will be displayed, and then the user can select the emoticon to click and display in the text box. This is basically the same as the fourth function, as follows The functions are described below
2. The first function
(1) Function display diagram
Since this is just a simple sliding effect, the screenshot does not look obvious, so I only posted the code
(2) Code
3. The second function
(1) Function screenshots
(2) Code
4. The third function
(1) Function screenshots
(2)Code
5. The fourth function
(1) Function screenshots
(2)Code
6. The fifth function
(1) Function screenshots
(2)Code
Alright, we have all the functions we should have. As for beautification, friends can do it by themselves