OpenSeaDragon CurtainSync Help

I am working on OpenseaDragon Curtainsync.
Following is the github repository which I have used in my code.

I want to change the images based on options selected in dropdown. I asked the author and following is his response:
The Curtain/Sync viewer isn’t set up to support opening a different set of images. I believe the assumption was you would have one page per set of images.

It probably wouldn’t be terribly hard to update the code to support this, if you wanted to. I can see two scenarios:

  1. Add a destroy function to CurtainSyncViewer so you can destroy the current viewer and create a new one with different images. That function might be as simple as:
    // ----------
    destroy: function () {
      if (this.mode) {
  1. You could add a setImages function to CurtainSyncViewer and move the image set up code from the constructor into it, along with forcing a setMode (I say forcing, since it first checks to see if you’re asking for a new mode and doesn’t bother changing if you’re not, but in this case you need to do it anyway because the images are new).

Both of these options require changes to the code, but I think they are relatively self-contained. The changes should be down in this area of the code:


window.CurtainSyncViewer = function (args) {
I tried but I am getting errors.
Can someone help me doing this?