Working left/right swipe with function triggering