Jquery 游览结束后,如何在jourde中添加自定义功能?
我用的是drupal用的。我想实现一个post回调功能,如下文参数postRideCallback中的代码所示 如何在下面添加自定义函数Jquery 游览结束后,如何在jourde中添加自定义功能?,jquery,drupal-7,zurb-joyride,Jquery,Drupal 7,Zurb Joyride,我用的是drupal用的。我想实现一个post回调功能,如下文参数postRideCallback中的代码所示 如何在下面添加自定义函数 /* Setting your options to override the defaults */ $('#contentID').joyride({ 'tipLocation': 'bottom', // 'top' or 'bottom' in relation to parent 'nubPosition': 'auto',
/* 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即可
但是,在这里引用自定义函数之前,请确保您已经定义了它。引用您的函数名而不是$noop。我已经添加了函数名,需要在哪里声明函数?因为它非常混乱,所以请在同一范围或更高级别范围内的任何地方声明它。谢谢您的帮助。我想你能详细说明你的答案吗?再添加一点关于你提供的解决方案的描述?@abarisone在参数postRideCallback中,默认值是$noop。这可以由函数的函数名替换。函数声明应位于此函数调用之前。希望这能把事情弄清楚!