occurs on a horizontal swipe movement

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


    //your code here


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 right to left" or "from left to right", you can calculate the difference between currentContext.x and startContext.x. If the difference is positive, swipe movement direction was "from left to right". In case of a negative value, the direction was "from right to left".

// example of usage
   if( c2.x - c1.x > 0 ){
        // swipe from left to right
       // swipe from right to left
Back to top
If you have not checked yet, be sure to visit site of our main product Webix js frameworks and page of tree ui product.