Collapsed By Default

+1 Kaveh Greenwood · September 8, 2014
I have this script on my page that allows me to expand and collapse pieces of an unordered list. I'd like to have each section collapsed by default.

Could anyone provide any input on what I can do?


      $('#customPricing > ul > li:has(ul)').addClass("has-sub");

      $('#customPricing > ul > li > a').click(function() {
        var checkElement = $(this).next();
        $('#customPricing li').removeClass('active');
        if(('ul')) && (':visible'))) {
        if(('ul')) && (!':visible'))) {
          $('#customPricing ul ul:visible').slideUp('normal');
        if ('ul')) {
          return false;
        } else {
          return true;  


Post a Reply


Oldest  Newest  Rating
0 Çağlan Turgut · September 10, 2014
I think being impatient is better so that people who has the same problem can see how you solved the problem :).
+2 Kaveh Greenwood · September 8, 2014
I solved my own problem again, haha. Just takes time. I get too impatient and post in the forums, but once I slow my mind down and do some research I learn what the problem is.

It wasn't even with the jQuery, it was CSS, haha.

#customPricing ul ul{
display: none;
  • 1



A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.