Jquery Openseadragon:使覆盖层可单击
在我的项目中,我使用的是深度变焦图像,因为我使用的是openseadragon。我想在我的图像上方做一个覆盖并使其可点击(点击可重定向到不同的html页面)。Jquery Openseadragon:使覆盖层可单击,jquery,Jquery,在我的项目中,我使用的是深度变焦图像,因为我使用的是openseadragon。我想在我的图像上方做一个覆盖并使其可点击(点击可重定向到不同的html页面)。 我使用以下代码: <script type="text/javascript"> OpenSeadragon({ id: "example-zoomit-tilesource", prefixUrl: "openseadrag
我使用以下代码:
<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>
jQuery(function() {
setTimeout(bindtooltip, 2000);
});
function bindtooltip(){
jQuery("#example-overlay").click(function(e){
alert('clicked');
});
};
OpenSeadragon({
id:“示例zoomit tilesource”,
前缀:“openseadragon/images/”,
瓷砖资源:[{
图片:{
xmlns:“http://schemas.microsoft.com/deepzoom/2009",
Url:“http://cache.zoom.it/content/WwI0_files/",
波浪化:“254”,
重叠:“1”,
格式:“jpg”,
ServerFormat:“默认”,
大小:{
宽度:“5816”,
身高:“3961”
}
}
}],
覆盖层:[{
id:'示例覆盖',
px:0,
py:0,
宽度:200,
身高:200,
类名:“突出显示”
}]
});
我获得了覆盖,但无法单击此覆盖。单击操作后,我想转到新的html页面。有人能帮我吗?试试这个
jQuery(function() {
setTimeout(bindtooltip, 2000);
});
function bindtooltip(){
jQuery("#example-overlay").click(function(e){
alert('clicked');
});
};
尝试使用
open
处理程序
jQuery(function() {
setTimeout(bindtooltip, 2000);
});
function bindtooltip(){
jQuery("#example-overlay").click(function(e){
alert('clicked');
});
};
var viewer = OpenSeadragon(); //pass your options here
viewer.addHandler("open", function(){
jQuery("#example-overlay").click(function(e){
alert('clicked');
});
});