Home >Web Front-end >JS Tutorial >How to use jquery to achieve label switching effect and click selection effect

How to use jquery to achieve label switching effect and click selection effect

一个新手
一个新手Original
2017-09-09 13:32:561517browse

The first step is to bind the click effects to all tab pages or rows that need to be switched using $(".delEquSign").on("click",function(){}).

The second step is to obtain the clicked object when clicking. You can perform specific operations. Usually, you also need to operate on non-clicked objects. The previous idea was to obtain a non-this object in the form of this, but on the Internet After looking for a very suitable method for a long time, I finally used $.each to loop through all the objects with bound effects, and then perform operations.

The third step is to loop first every time you click, and then operate on this.

$(".delEquSign").on("click",function(){
             $.each($(".delEquSign"), function(index,item) {
                                                            ($(item).css("background-color","#dedede")){
                                                                                                     .find("input").css("background-color","#FFFFFF");
                     }
                                               ; dedede");
              $(this).find("input").css("background-color","#dedede");
          });

The above is the detailed content of How to use jquery to achieve label switching effect and click selection effect. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn