Home > Web Front-end > Front-end Q&A > What to do if jquery control fails

What to do if jquery control fails

藏色散人
Release: 2021-11-11 09:29:19
Original
1598 people have browsed it

Solution to the failure of jquery control: 1. Open the corresponding js code file; 2. Pass "$("#xxx").show("slow",function(){$(this).css ("display","block")});" just do it.

What to do if jquery control fails

The operating environment of this article: windows7 system, jquery3.2.1 version, DELL G3 computer

What should I do if the jquery control fails?

About jquery's problem of hiding and displaying controls

Generally, if we want to dynamically display or hide html jsp controls, we can use jquery's own methods

 $("#id").hide();
 
 $("#id").show();
Copy after login

But sometimes when we dynamically control the hiding or display of elements in the control, failure may occur.

For example, if th tr in a div or li in ul hide the div ul, it may not be possible to hide the controls inside, so this will fail.

Solution:

   $("#xxx").hide("slow",function(){$(this).css("display","none")}); 
 
   $("#xxx").show("slow",function(){$(this).css("display","block")});
Copy after login

For the slow function, I looked at the source code and found that it is a speed control for hiding or displaying.

Optional parameters include fast and _default.

As for the choice, it depends on your own preferences.

Recommended learning: "jquery video tutorial"

The above is the detailed content of What to do if jquery control fails. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template