Openseadragon:使叠加层可点击

时间:2013-07-08 09:08:26

标签: jquery

在我的项目中,我正在使用深度缩放图像,因为我正在使用openseadragon。我想在我的图像上面做一个叠加并使其可点击(点击以重定向到不同的html页面) 我使用以下代码:

    <script type="text/javascript">
        OpenSeadragon({
            id:            "example-zoomit-tilesource",
            prefixUrl:     "openseadragon/images/",
            tileSources:   [{ 
                Image:  {
                    xmlns: "http://schemas.microsoft.com/deepzoom/2009",
                    Url: "http://cache.zoom.it/content/WwI0_files/",
                    TileSize: "254", 
                    Overlap: "1", 
                    Format: "jpg", 
                    ServerFormat: "Default",
                    Size: { 
                        Width: "5816",
                        Height: "3961"
                    }
                }
            }],
            overlays: [{
        id: 'example-overlay',
        px: 0, 
        py: 0, 
        width: 200, 
        height: 200,
        className: 'highlight'

   }]

   });
    </script>

我有叠加,但是这个叠加无法点击。在点击的动作我想去新的html page.can任何人帮助我。?

2 个答案:

答案 0 :(得分:0)

试试这个,

                jQuery(function() {
                    setTimeout(bindtooltip, 2000);
                });

                function bindtooltip(){              
                    jQuery("#example-overlay").click(function(e){
                       alert('clicked');
                    });
                };

答案 1 :(得分:0)

尝试使用open处理程序

var viewer = OpenSeadragon(); //pass your options here
viewer.addHandler("open", function(){
    jQuery("#example-overlay").click(function(e){
        alert('clicked');
    });
});
相关问题