Slider Revolution WP
09.27.2016
1 2 3 4 5 6 7 8 9 |
jQuery(window).one('load', function() { // modify the "revapi1" part with your slider's API name listed here: // https://www.themepunch.com/revslider-doc/api/ revapi1.revstart(); }); |
1 2 3 4 5 6 7 8 9 10 11 |
// possibly useful if the slider is in the page's header and not // necessarily part of the Ajax content that's retrieved jQuery('#content').load(someWebPageURL, function() { // modify the "revapi1" part with your slider's API name listed here: // https://www.themepunch.com/revslider-doc/api/ revapi1.revstart(); }); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
function getCurrentSliderAPI() { var slider = jQuery('.rev_slider'); if(!slider.length) return false; return eval('revapi' + slider.attr('id').split('rev_slider_')[1].split('_')[0]); } function startSlider() { var revapi = getCurrentSliderAPI(); if(revapi) { // start new slider // assuming the "revapi1.revstart()" option has // been turned on in the slider's General Settings revapi.revstart(); } } function killSlider() { var revapi = getCurrentSliderAPI(); if(revapi) { // destroy current slider revapi.revkill(); revapi = null; } } function loadNewAjaxContent() { killSlider(); jQuery('#content').load(someWebPageURL, pageContentLoaded); } function pageContentLoaded() { startSlider(); } |