It's possible Drupal.attachBehaviors will be called after page load by other modules which may be using jquery to add elements to the DOM.

First the slider behavior should restrict its selections by the context variable.

Also, it probably makes sense to add a "processed" class to avoid re-initialing the same slider if a module passes the document context when calling attachBehaviors.

Attached is a patch which does this.

CommentFileSizeAuthor
views_nivo_slider-behaviors-context.patch715 byteskrlucas
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bomarmonk’s picture

I'm using a flash audio player and megamenus on my front page. Every now and then, the slider doesn't load properly, or the menu animation fails on my home page with the nivo slider (this last issue seems to happen with Safari only). Could this patch fix this problem?