title: Call CSS Class instead of inserting Attribute using JQuery (.css())
body: <p>I am building a fixed header with using JQuery</p>
  
  <p>Everything is working fine at the moment but instead of setting attributes to classes and I want to call them from css directly. I am not quite familiar with this method.</p>
  
  <p>One of the example is below;</p>
  
  <pre class="lang-css prettyprint-override"><code>#header-main {
    background-color: #ffffff;
    min-height: 107px;
    color: #8c8c8c;
  }
  #header-main .sabit{
  position : fixed;
  width: 100%;
  z-index: 98;
  padding-top: 35px;
  border-bottom: 3px ridge #7BBD42;
  }
  </code></pre>
  
  <p>How I am doing is; <strong><em>(Working)</em></strong></p>
  
  <pre><code>var menu = $('#header-main');
  if (...)
      menu.css('position','fixed').css('width','100%').css('z-index','98').css('padding-top','35px').css('border-bottom','3px ridge #7BBD42');
  else
      menu.removeAttr('style'); //Back to normal
  </code></pre>
  
  <p>What I am doing to achieve what I want; <strong><em>(Not working)</em></strong></p>
  
  <pre><code>var menu = $('#header-main');
  if(...)
      menu.addClass("sabit");
  else
      menu.removeClass("sabit"); //Back to normal
  </code></pre>
  
  <p>I also tried <code>menu.addClass(".sabit");</code> or <code>menu.addClass("#header-main .sabit");</code> but none of them worked. </p>
  
  <p>What part am I doing wrong to add directly css class using JQuery?</p>