How to initiate Nivo Slider in ajax loaded content?

不问归期 提交于 2019-12-02 09:47:38

inside your .work a function, try this. Note however, that you must use the correct nivo slider html structure for .pictures.

$('div.work').click(function(e) { 
  $('.pictures').show();
  $('.pictures').data('nivoslider').stop().start; //Stop the Slider if it's currently running, then start it.
  e.preventDefault(); 
});

As it turns out, the problem here was not the code, but a conflict between an older version of Nivo Slider and the current version of jQuery (1.7.1). When I went back to jQuery 1.4.2 it worked. Then I updated Nivo Slider to the latest version with the current jQuery and it also worked.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!