onSwipeY

occurs on a vertical swipe movement

void onSwipeY(object start_context,object current_context);
start_contextobjectobject with parameters of swipe event start
current_contextobjectobject with parameters of swipe event end

Example

webix.attachEvent("onSwipeX",function(start_context,current_context){
    //your code here
});

Details

Parameters of the start_context and current_context objects are given below:

  • x - {number} horizontal event position
  • y - {number} vertical event position
  • target - {object} the html element where the event started/ended
  • time - {Date object} the time of event start/end

To check whether the swipe direction is "from bottom to top" or "from top to bottom", you can calculate the difference between currentContext.y and startContext.y. If the difference is positive, swipe movement direction was "from bottom to top". In case of a negative value, the direction was "from top to bottom".

// example of usage
webix.attachEvent("onSwipeY",function(c1,c2){
   if( c2.y - c1.y > 0 ){
        // swipe from bottom to top
    }
   else{
       // swipe from top to bottom
   }
});
Back to top
If you have not checked yet, be sure to visit site of our main product Webix javascript ui framework and page of javascript gage product.