我正在使用 Joyride drupal 的 Joyride Tour for drupal 使用 joyride drupal 模块。我想实现一个后回调功能,如下下面参数postRideCallback的代码中给出的如何在下面添加自定义函数?
/* Setting your options to override the defaults */
$('#contentID').joyride({
'tipLocation': 'bottom', // 'top' or 'bottom' in relation to parent
'nubPosition': 'auto', // override on a per tooltip bases
'scrollSpeed': 300, // Page scrolling speed in ms
'timer': 2000, // 0 = off, all other numbers = time(ms)
'startTimerOnClick': true, // true/false to start timer on first click
'nextButton': true, // true/false for next button visibility
'tipAnimation': 'pop', // 'pop' or 'fade' in each tip
'pauseAfter': [], // array of indexes where to pause the tour after
'tipAnimationFadeSpeed': 300, // if 'fade'- speed in ms of transition
'cookieMonster': true, // true/false for whether cookies are used
'cookieName': 'JoyRide', // choose your own cookie name
'cookieDomain': false, // set to false or yoursite.com
'tipContainer': body, // Where the tip be attached if not inline
'postRideCallback': $noop, // a method to call once the tour closes
'postStepCallback': $noop // A method to call after each step
});
只需将$noop替换为自定义函数即可。
但是,请确保在此处引用自定义函数之前已定义自定义函数。