You have to inject the value of current into an Attribute Equals selector:
$(“ul”).find(`[data-slide=’${current}’]`)
For older JavaScript environments (ES5 and earlier):
$(“ul”).find(“[data-slide='” + current + “‘]”);
in case you don’t want to type all that, here’s a shorter way to query by data attribute:
$(“ul[data-slide='” + current +”‘]”);
FYI:
http://james.padolsey.com/javascript/a-better-data-selector-for-jquery/