Home > Article > Web Front-end > What to do if jquery control fails
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.
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();
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")});
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!