Search code examples
javascriptopenseadragon

adding div to openseadragon Toolbar is not working [Openseadragon]


when I add the tollbar(as in this example: http://openseadragon.github.io/examples/ui-toolbar/) properties I get an error Cannot read property 'appendChild' of null

I just want to add a div to the buttons to controlling their margin/padding

 var viewer1 = OpenSeadragon({
                 id: "mainImage",
                 maxZoomPixelRatio:6,
                toolbar:"toolbarDiv",
                panVertical:    false,
               defaultZoomLevel:    0.75,
               minZoomLevel:    0.75,
               visibilityRatio:     1,
                 preserveViewport:true, /
                 preserveImageSizeOnResize : true,
                 prefixUrl: "img",
       });

Solution

  • As mentioned in https://github.com/openseadragon/openseadragon/issues/1140: Do you have an element on your page with the id toolbarDiv? If not, you'll get that error.