JQuery binding events, removal events and animations
BindingEvent: bind(), on(), live(), delegate(), keyup();
Trigger event: trigger( 'keyup'), keyup();
Unbinding events: unbind(), off(), die(), undelegate();
Conforming events: hover(), toggle();
Events Binding: bind();
##1. Binding event
JQueryBinding events, in addition to the bing() method, there are also
on(),
live(),
one( ) Binding methods for other
events.
Binding event classification:
(a) Binding a single event$("#btn").bind("click",function(){ //代码块 console.log(123); });
$("#btn").bind({ mouseover:function(){ $(this).css("background","red"); console.log("代码块1"); }, mouseout:function(){ console.log("代码块2"); }, click:function(){ console.log("点击事件"); } });
http://www.php100.com/html/program/jquery/2013/0905/5993. html
(a) Use the unbind() method to remove the event
$("button").click(function(){ $("p").unbind(); });
show()
——— Method controls the display of elements;
hide()
— ——-Method to control the display of elements;
toggle()
——-Method to switch the visible
state of elements;fadeIn()
——-Method fade in;
fadeOut()
——Method fade out;
slideUp()
——Method to realize the shrinkage of elements
slideDown()
——Method Implement the expansion of elements
Unbinding events: unbind(), off(), die(), undelegate();
Conforming events: hover(), toggle ();
Event binding: bind();
##1. Binding events
JQuery binding events, in addition to the bing()
method, there are alsoon(),
live(),
one () Binding methods for
and other events.
Binding event classification:
(a) Binding a single event
$("#btn").bind("click",function(){ //代码块 console.log(123); });
$("#btn").bind({ mouseover:function(){ $(this).css("background","red"); console.log("代码块1"); }, mouseout:function(){ console.log("代码块2"); }, click:function(){ console.log("点击事件"); } });
http://www.php100.com/html/program/jquery/2013/0905/5993. html
2. Remove the event
(a) Use the unbind() method to remove the event
$("button").click(function(){ $("p").unbind(); });
In Jquery, a series of methods for displaying animation effects are provided, among which,
- show()
- ——— Method controls the display of elements;
- ——— Method controls the display of elements;
- ——-Method switches the visible state of the element;
- — ——Method fade in;
- ——Method fade out;
##slideUp() ——Method to realize the shrinking of elements -
slideDown() ——Method to realize the expansion of elements
The above is the detailed content of JQuery binding events, removal events and animations. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











MetaMask (also called Little Fox Wallet in Chinese) is a free and well-received encryption wallet software. Currently, BTCC supports binding to the MetaMask wallet. After binding, you can use the MetaMask wallet to quickly log in, store value, buy coins, etc., and you can also get 20 USDT trial bonus for the first time binding. In the BTCCMetaMask wallet tutorial, we will introduce in detail how to register and use MetaMask, and how to bind and use the Little Fox wallet in BTCC. What is MetaMask wallet? With over 30 million users, MetaMask Little Fox Wallet is one of the most popular cryptocurrency wallets today. It is free to use and can be installed on the network as an extension

In today's era of information explosion, the construction of personal brand and corporate image has become increasingly important. As the leading fashion life sharing platform in China, Xiaohongshu has attracted a large number of user attention and participation. For those users who want to expand their influence and improve the efficiency of content dissemination, binding sub-accounts has become an effective means. So, how does Xiaohongshu bind a sub-account? How to check whether the account is normal? This article will answer these questions for you in detail. 1. How to bind a sub-account on Xiaohongshu? 1. Log in to your main account: First, you need to log in to your Xiaohongshu main account. 2. Open the settings menu: click "Me" in the upper right corner, and then select "Settings". 3. Enter account management: In the settings menu, find the "Account Management" or "Account Assistant" option and click

1. Open Toutiao. 2. Click My in the lower right corner. 3. Click [System Settings]. 4. Click [Account and Privacy Settings]. 5. Click the button on the right side of [Douyin] to bind Douyin.

We often use ppt in our daily work, so are you familiar with every operating function in ppt? For example: How to set animation effects in ppt, how to set switching effects, and what is the effect duration of each animation? Can each slide play automatically, enter and then exit the ppt animation, etc. In this issue, I will first share with you the specific steps of entering and then exiting the ppt animation. It is below. Friends, come and take a look. Look! 1. First, we open ppt on the computer, click outside the text box to select the text box (as shown in the red circle in the figure below). 2. Then, click [Animation] in the menu bar and select the [Erase] effect (as shown in the red circle in the figure). 3. Next, click [

How to use PUT request method in jQuery? In jQuery, the method of sending a PUT request is similar to sending other types of requests, but you need to pay attention to some details and parameter settings. PUT requests are typically used to update resources, such as updating data in a database or updating files on the server. The following is a specific code example using the PUT request method in jQuery. First, make sure you include the jQuery library file, then you can send a PUT request via: $.ajax({u

The Cainiao app is a platform that can provide you with various logistics information. The functions here are very powerful and easy to use. If you have any logistics-related problems, they can be solved here. Anyway, it can bring you a The one-stop service can solve everything in time. Checking the express delivery, picking up the express delivery, sending the express delivery, etc. are all without any problems. We have cooperated with various platforms and all the information can be queried. However, sometimes It will happen that the goods purchased on Pinduoduo cannot display the logistics information. In fact, you need to manually bind Pinduoduo to achieve this. The specific methods have been sorted out below, and everyone can take a look. . How to bind Cainiao to Pinduoduo account: 1. Open Cainiao APP and go to the main page

Do you know how to bind Pinduoduo when using Cainiao Wrap? The official version of Cainiao Wrap App does not automatically synchronize some Pinduoduo’s logistics information on this platform. All we need to do is You can copy the order number or check your mobile phone to see if there is any express delivery information. Of course, these all need to be completed manually. If you want to know more, come and take a look with the editor. How to bind the Cainiao APP to Pinduoduo 1. Open the Cainiao APP and click "Package Guide" in the upper left corner of the main page. 2. In the interface, there are many shopping websites, and accounts can be bound. 3. Click to import other e-commerce platforms. 4. User authorization: Click Pinduoduo to go to the interface

Title: jQuery Tips: Quickly modify the text of all a tags on the page In web development, we often need to modify and operate elements on the page. When using jQuery, sometimes you need to modify the text content of all a tags in the page at once, which can save time and energy. The following will introduce how to use jQuery to quickly modify the text of all a tags on the page, and give specific code examples. First, we need to introduce the jQuery library file and ensure that the following code is introduced into the page: <
