Previously written show hide is always controlled with the JQ method:
dom.show();dom.hide();
In fact, this still has a lot of flaws.
This is the HTML structure:
<divclass="holi"> somewords </div> <divid="button">点击显示</div>
If you use Position:absolute and top-9999px control points to hide
.holi{ width: 200px; height: 200px; border: 1px solid red; position: absolute; visibility: hidden; }
This should be the way to use JQ to show him better.
$(function(){ $(‘#button‘).click(function(){ $(‘.holi‘).css({ ‘position‘:‘static‘, }) }) })
If it is Position:absolute+visibility:hidden, the hidden words of control:
That
.holi{ width: 200px; height: 200px; border: 1px solid red; position: absolute; visibility: hidden; }
This should be done with the JQ control display:
$(function(){ $(‘#button‘).click(function(){ $(‘.holi‘).css({ ‘position‘:‘static‘, ‘visibility‘:‘visible‘ }) }) })
And of course show hide directly calls this method completely hidden.
Element hiding and display is very common in the implementation of page making and interactive effect, if you just use Display:none and display:block/inline to implement the explicit control of DOM elements, then you are out.
If you want the hidden content to be recognized by the secondary reading device, you cannot use Display:none and Visibility:hidden to hide the elements. You can use the hidden method of impersonation hiding, also known as usability concealment. ABSOLUTE+TOP:-9999PX: If you want to be completely hidden, you can use Display:none or Visibility:hidden.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
CSS Relative/Absolute (Relative/absolute) positioning with jquery control display hidden