title: How to deal with hide and show in backbone
body: <p>I have the following HTML template.</p>
  
  <pre><code>&lt;script type="text/template" id="friend-request-list"&gt;
  &lt;div class="row-fluid"&gt;
      &lt;ul class="nav nav-stacked nav-pills"&gt;
          &lt;@ friendRequestCollection.each(function(user) { @&gt;
              &lt;li id="user-list-&lt;@= user.get('username') @&gt;"&gt;&lt;a href="#"&gt;&lt;@= user.get('firstName') @&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;@ }); @&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>This template is shown in the following pendingFriendRequest div,</p>
  
  <pre><code>&lt;ul class="nav pull-left"&gt;
                      &lt;li&gt;
                        &lt;div id="pendingFriendRequest" class="notired"&gt;${nbFriendRequest}&lt;/div&gt;&lt;a href="#" class="notifriend"&gt;&lt;i class="icon-eye-open icon-white"&gt;&lt;/i&gt;&lt;/a&gt;
                     &lt;/li&gt;
                  &lt;/ul&gt;
  </code></pre>
  
  <p>The backbone code is as follows</p>
  
  <pre><code>app.View.FriendRequestListView = Backbone.View.extend( {
  template: _.template($('#friend-request-list').html()),
  
  tagName: 'div',
  
  initialize: function(){
      this.friendRequestCollection = new app.Collection.FriendRequestCollection();
      this.friendRequestCollection.bind("reset", this.render, this);
      this.friendRequestCollection.fetch();
  
      var self = this;
  },
  
  render: function() {
      $(this.el).html(this.template({
          friendRequestCollection: this.friendRequestCollection}));
      return $(this.el);
  }
  
  });
  
   app.Collection.FriendRequestCollection = Backbone.Collection.extend({
     url : function(){
        return '/rest/friendRequests';
     }
    });
  </code></pre>
  
  <p>But now what i wanted is that the list should be invisible and only when the link is clicked the list is displayed as a menu. On clicking somehwere else or if the cursor is moved to somewhere else the menu must hide.</p>
  
  <p>IS this possible. I am newbie in backbone so dont know how to do this.</p>