/* Use this file to customize your site with Javascript */ /** * Display the slide of a revolution slider * Important note: The slider must be set to "Hero Scene" and the "Wait for revapi2.revstart()" must be True * @param {*} $slide_index Index (Based 1) of the slide to display * @param {*} $api_name Name of the revslider api */ function showRevSlide($slide_index,$api_name){ const fnReady = function(){ return new Promise( function($resolve, $reject) { const fnCheck = function(){ if(window[$api_name] != undefined){ $resolve(window[$api_name]); } else{ window.setTimeout(fnCheck, 250); } } fnCheck(); }) } jQuery(document).ready(function(){ fnReady().then(function($api){ $api.revshowslide($slide_index); $api.revstart(); }) }); }