Home:ALL Converter>Toggle hide and show

Toggle hide and show

Ask Time:2014-07-25T00:52:22         Author:giff1

Json Formatter

I have tried everything to get it to toggle show and hide but every time I add hide in the function, it stops working or I can get hide to work flawlessly while show doesn't work at all. Any help would be appreciated.

<div class="ShowHideClicker clear" >
  <img src="something.gif"></div> <div class="ShowHideList"> 
  <div class="ui-widget" id="SearchBar"> 
    <label for="tags">Search:</label> 
    <input id="tags">
    <button class='clear' id="ClearButton"> Clear</button> 
  </div> 
  <div id="Result"></div> 
</div>

$(document).ready(function(){
     $('.ShowHideList').hide();
     $('.ShowHideClicker').click(function(){
          $(this).next().show('drop', {direction: 'left'}, 1000);
     });
});

Author:giff1,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/24939645/toggle-hide-and-show
astx123 :

Here is the simple solution with toggleClass:\n\n$('.ShowHideClicker').on('click', function(){\n $(this).next().toggleClass('hidden');\n});\n\n\nhttp://jsfiddle.net/LcYLY/",
2014-07-24T17:20:28
yy