title: Javascript : building an image gallery with backbone
body: <p>I'm building an image gallery using backbone. User can only view one image at a time, when he navigates next/previous using arrow keys he will see next image in the collection.</p>
  
  <p>I have one top level backbone view called gallery view. </p>
  
  <pre><code>GalleryView = Backbone.View.extend({
      initialize: function(options) {
          this.collection = PhotosCollection();
      }
  });
  </code></pre>
  
  <p>Then for each image I'll create a view</p>
  
  <pre><code>PhotoView = Backbone.View.extend
  </code></pre>
  
  <p>I'll keep track of current model in collection that is in view, and I'll create photoView for that model.</p>
  
  <p>My question is regarding pagination, or prefetching images that are not in view. I'm not sure about how galleryView can hold multiple PhotoViews and then show the one that is in focus. I'm thinking about building one long div for entire collection and then adding div's for each photo onto it in the indexed position. What would be the strategy of adding removing new images from that div.</p>