diff --git a/dev/js/spec/menuSpec.js b/dev/js/spec/menuSpec.js
index a60d7ab..ba534de 100644
--- a/dev/js/spec/menuSpec.js
+++ b/dev/js/spec/menuSpec.js
@@ -1380,6 +1380,80 @@
         expect(menu.shownItem(2).lcField()).toEqual(' veröffentlichungsdatum');
       });
 
+      it('should be view upable and downable (1)', function () {
+        var menu = KorAP.OwnMenu.create(demolonglist);
+        menu.limit(7);
+
+        // Choose the final value
+        expect(menu.show(1)).toBe(true);
+
+        expect(menu.shownItem(0).active()).toBe(false);
+        expect(menu.shownItem(0).lcField()).toEqual(' titel');
+        expect(menu.shownItem(1).active()).toBe(true);
+        expect(menu.shownItem(2).active()).toBe(false);
+        expect(menu.shownItem(2).lcField()).toEqual(' veröffentlichungsdatum');
+        expect(menu.shownItem(6).active()).toBe(false);
+        expect(menu.shownItem(7)).toBe(undefined);
+
+        // Doesn't change anything
+        menu.viewUp();
+
+        expect(menu.shownItem(0).active()).toBe(false);
+        expect(menu.shownItem(0).lcField()).toEqual(' titel');
+        expect(menu.shownItem(1).active()).toBe(true);
+
+        menu.viewDown();
+
+        expect(menu.shownItem(0).active()).toBe(true);
+        expect(menu.shownItem(0).lcField()).toEqual(' untertitel');
+        expect(menu.shownItem(1).active()).toBe(false);
+
+        menu.viewDown();
+
+        expect(menu.shownItem(0).active()).toBe(false);
+        expect(menu.shownItem(0).lcField()).toEqual(' veröffentlichungsdatum');
+        expect(menu.shownItem(1).active()).toBe(false);
+
+        // No effect anymore
+        menu.viewDown();
+
+        expect(menu.shownItem(0).active()).toBe(false);
+        expect(menu.shownItem(0).lcField()).toEqual(' veröffentlichungsdatum');
+        expect(menu.shownItem(1).active()).toBe(false);
+      });
+
+      it('should be view upable and downable (2)', function () {
+
+        // List is longer than limit
+        var menu = KorAP.OwnMenu.create(demolist);
+        menu.limit(7);
+
+        // Choose the final value
+        expect(menu.show(1)).toBe(true);
+
+        expect(menu.shownItem(0).active()).toBe(false);
+        expect(menu.shownItem(0).lcField()).toEqual(' titel');
+        expect(menu.shownItem(1).active()).toBe(true);
+        expect(menu.shownItem(2).active()).toBe(false);
+        expect(menu.shownItem(2).lcField()).toEqual(' veröffentlichungsdatum');
+        expect(menu.shownItem(4).active()).toBe(false);
+        expect(menu.shownItem(5)).toBe(undefined);
+
+        // Doesn't change anything
+        menu.viewUp();
+
+        expect(menu.shownItem(0).active()).toBe(false);
+        expect(menu.shownItem(0).lcField()).toEqual(' titel');
+        expect(menu.shownItem(1).active()).toBe(true);
+
+        menu.viewDown();
+
+        expect(menu.shownItem(0).active()).toBe(false);
+        expect(menu.shownItem(0).lcField()).toEqual(' titel');
+        expect(menu.shownItem(1).active()).toBe(true);
+      });      
+
+      
       it('should scroll to a chosen value (1)', function () {
         var menu = KorAP.OwnMenu.create(demolist);
         menu.limit(3);
diff --git a/dev/js/src/menu.js b/dev/js/src/menu.js
index 1f9d849..1fb1ffd 100644
--- a/dev/js/src/menu.js
+++ b/dev/js/src/menu.js
@@ -338,13 +338,18 @@
       }
       else if (e.type === "touchmove") {
         var t = e.touches[0];
+
+        // TODO:
+        // Instead of using 26px, choose the item height
+        // or use the menu height // shownItems
+        
         // s.movetoRel(t.clientY - this._initTouch);
         if ((this._lastTouch + 26) < t.clientY) {
-          this.screen(this.offset - 1);
+          this.viewDown();
           this._lastTouch = t.clientY;
         }
         else if ((this._lastTouch - 26) > t.clientY) {
-          this.screen(this.offset + 1);
+          this.viewUp();
           this._lastTouch = t.clientY;
         }
         e.halt();
@@ -425,19 +430,32 @@
      * in the viewport.
      */
     screen : function (nr) {
+
+      // Normalize negative values
       if (nr < 0) {
         nr = 0
       }
+
+      // The shown list already shows everything
+      else if (this.liveLength() < this.limit()) {
+        return false;
+      }
+
+      // Move relatively to the next screen
       else if (nr > (this.liveLength() - this.limit())) {
         nr = (this.liveLength() - this.limit());
       };
 
+      // no change
       if (this.offset === nr)
-        return;
+        return false;
 
       this._showItems(nr);
+
+      return true;
     },
 
+
     /**
      * Get the associated dom element.
      */
@@ -677,7 +695,7 @@
       return this._list.length;
     },
 
-
+    
     /**
      * Make the next item in the filtered menu active
      */
@@ -816,6 +834,21 @@
     },
 
 
+    /**
+     * Move the view one item up
+     */
+    viewUp : function () {
+      this.screen(this.offset - 1);
+    },
+
+
+    /**
+     * Move the view one item down
+     */
+    viewDown : function () {
+      this.screen(this.offset + 1);
+    },
+
     // Unmark all items
     _unmark : function () {
       for (var i in this._list) {
