       flightViewport.style.height = content.offsetHeight + "px"
     else
       throw new Error "#flight or .content not found."
-
+  
+  setScroller: (wrapper) =>
+    
+      if @iScrollInstance? then @iScrollInstance.destroy(); @iScrollInstance = null
+    
+      window.setTimeout =>
+        @iScrollInstance = new iScroll(wrapper.getElementsByClassName('wrapper')[0].id)        
+      , 0
   # detects user agent being used
   detectUserAgent: ->
     userAgent = window.navigator.userAgent

      @startPanel = document.querySelector startPanel
      if @startPanel is undefined then throw new Error "Cannot find start panel"
    else
      @startPanel = startPanel    
    
  # Goes to page, transitionAnimation defines if transition happens or not
  goToPage: (targetPanel, options) =>

    @back = false
    @isTransitioning = false
    @currentPanel.removeEventListener "webkitTransitionEnd", @finishTransition, false
    
    if @useScroller is true
      @setScroller(@targetPanel)
   
   # displays pages when transiton is false
   displayPage: =>
    @targetPanel.style.display = "block"
