 
     oldIndex = elements.indexOf @element
     newIndex = Math.max 0, Math.min elements.length - 1, oldIndex + 1
+    Common.log oldIndex, newIndex, elements.length if @debug.select
 
     if (@element and newIndex == oldIndex) or not elements[newIndex]
+      Common.log "  scroll (smooth)" if @debug.select
       element = @element ? document.body
       amount = 100 * if action == "up" then -1 else 1
       Scroller.scrollBy (@element ? document.body), "y", amount, true

      # perspective.
      if @element and newIndex != oldIndex
        { top, bottom } = @element.getBoundingClientRect()
        if action == "up" and top < 0
          newIndex = oldIndex
        else if action == "down" and @config.offset < top and innerHeight < bottom
          newIndex = oldIndex

      @selectElement elements[newIndex]

  eventToAction: do ->

    search = (selector) ->
      if all then element.querySelectorAll selector else element.querySelector selector
    try
      Common.log "#{selector} #{all}" if @debug.selector
      Common.log "  #{search(selector).length}" if @debug.selector
      search selector
    catch
      console.error "bad CSS selector: #{selector}"
