title: Do some work before element rendered
body: <p>I am trying to add some css styles (<code>display: none</code>) before an element is rendered.</p>
  
  <p>The problem is that I'm trying to do it in a jQuery plugin and I can't initialize the plugin in the header.</p>
  
  <p>I'm not sure what is possible in my case</p>
  
  <p>Plugin:</p>
  
  <pre><code>(function ($) {
      var methods = {
          init: function (options) {
             if (options.collapsed_mode) {
                $('#menu').hide();
             }
          }
      };
  
      $.fn.dropright = function (method) {
  
          if (methods[method]) {
              methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
          } else if (typeof method === 'object' || !method) {
              return methods.init.apply(this, arguments);
          } else {
              $.error('Method ' + method + ' not found');
          }
          return true;
      };
  });
  </code></pre>
  
  <p>Page:</p>
  
  <pre><code>&lt;?php include 'templates/header.php'; ?&gt;
  &lt;div id="wrapper"&gt;
      &lt;div id="menu"&gt;
         Hello, world ;)
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;?php include 'templates/fooer.php'; ?&gt;
  </code></pre>
  
  <hr>
  
  <h2>Update</h2>
  
  <p>I can't add to the css file <code>display: none</code> because, in different pages, I need different values for <code>display</code>. For example, where the plugin is included, I need <code>display: none</code>, but for any another, the element should not be hidden.</p>