Skip to content

$.show() & $.hide()

Arthur Guiot edited this page Jul 8, 2017 · 1 revision

How they work?

As you can imagine, the $.show() an element, and the $.hide() function is to hide it. These 2 function are using the display: style from CSS.

How to use them?

These functions only require an element as arguments, but no more. To see how they work, I'll take an example. When I click on a button, it will show an element, and if I click on another button, this element it will hide this element.

HTML:

<div class="toggleVisibility">You can see me!</div>
<button class="hide">Hide</button>
<button class="show">Show</button>

JS:

$.on($.select(".hide"), "click", $.hide($.select(".toggleVisibility"))
$.on($.select(".show"), "click", $.show($.select(".toggleVisibility"))

⚠️ Questions?

Don't hesitate to ask your questions ⁉️ in the issue part 😁

Clone this wiki locally