OWL slider trigger based on count

Please find below code 
var count = 2
var duration = 500;
jQuery('.owl-slider').trigger('to.owl.carousel', [count, duration, true]);