How to reinit lightbox script (fancybox) on course status pages loaded via ajax

Home Forums Legacy Support Support queries How-to & Troubleshooting How to reinit lightbox script (fancybox) on course status pages loaded via ajax

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #90304
    rumitru
    Participant
    In course status pages, if user open second time some unit (by clicking on next/previous buttons or via course curriculum) and it's loading via ajax, the fancybox on images not working (the same problem with any other lightbox script). I think i need reinitialize fancybox when ajax request is succcess, for example:
    ajax: { success: function(content) { this.set('content.text', content);   // Fancybox call } }
    but i can't find in which file i must do this changes. Can anyone help me?
    #90419
    rumitru
    Participant
    Perhaps, you don't undestand what i mean (sorry for my english). See screencast, please: http://screencast-o-matic.com/watch/cbVb2vQGuw
    #90586
    H.K. Latiyan
    Participant
    You can simply add the js for it in the unit_traverse, refer: https://wplms.io/support/knowledge-base/run-custom-actions-on-unit-load/ Add the js inside the code and add the code in your custom js file or add it in the script tags in the wplms->footer->google analytics code.
    #90632
    rumitru
    Participant
    Thanks! It works!!!
    #90667
    H.K. Latiyan
    Participant
    Thanks for the update, so closing the topic.
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to reinit lightbox script (fancybox) on course status pages loaded via ajax’ is closed to new replies.