I’ve got a toggle set on an element that I want to show hide 4 elements (3 ids, 1 class).
Here’s my jquery
$('#tap-menu').click(function() {
$('#left-column, #settings, #ortibi, .userprofile').toggle();
});
These 4 elements are hidden on page load and on the first toggle, show all of them. If I toggle to hide again, that’s fine. But if I toggle to show them again. The .userprofile doesn’t show. Is this because it’s a class rather than an id in the CSS?
Why would that effect it?
Thanks in advance…
Instead of using
display: none;on the .userprofile css, hide the elements with jquery like this:See this for more information: http://api.jquery.com/hide/
Specifically:
Conversely, if it initially has a value of
display: none;toggling it back on will give it the same value ofdisplay: none;.