javascript - ImageMapster“突出显示”始终打开
问题描述
我使用 jquery、ImageMapster 和 PHP。
该脚本工作正常,如果我加载图像,我的区域是 ON 但是当我将鼠标移到图像上时,突出显示更改(正常)但是......当我将 mouseOut 放在 img 时我没有选择区域,并且想要我的默认值区域开。
我使用 mouseOut 始终调用相同的区域来解决问题。我想正确地做到这一点。
<script type="text/javascript">
function mapearImagenVistaGeneral(id) {
$(id).mapster({
mapScale : true,
fillOpacity : 0.4,
fillColor : "fff000",
stroke : true,
strokeColor : "000",
strokeOpacity: 0.8,
strokeWidth : 4,
singleSelect : true,
mapKey : 'name',
listKey : 'name',
showToolTip : true,
onMouseout: function (e) {
$('#imgAlmacen1VistaGeneral').mapster( 'highlight','01');
}
});
};
mapearImagenVistaGeneral("#imgAlmacen1VistaGeneral");
$('#imgAlmacen1VistaGeneral').mapster( 'highlight','01');
解决方案
2天后,我终于找到了解决方案,在stackoverflow中写入......
我必须设置一个区域。
<script type="text/javascript">
function mapearImagenVistaGeneral(id) {
$(id).mapster({
mapScale : true,
fillOpacity : 0.4,
fillColor : "fff000",
stroke : true,
strokeColor : "000",
strokeOpacity: 0.8,
strokeWidth : 4,
singleSelect : true,
mapKey : 'name',
listKey : 'name',
showToolTip : true,
areas: [{
key: '01',
staticState: true,
render_select: {
fillOpacity: 0.4,
fillColor: '0000ff'
}}
]
});
};
mapearImagenVistaGeneral("#imgAlmacen1VistaGeneral");
推荐阅读
- java - 如何忽略本机查询中的@Where 子句?
- flutter - Flutter Webview onStateChanged 没有被触发
- c++ - 退出语句不会退出所有进程
- google-app-engine - G-Cloud SDK 应用程序:如何授权 sdk 应用程序访问谷歌表格
- node.js - 登录端点在我的机器上不起作用,但在其他地方可以
- sharepoint - Modern Sharepoint Online 页面上的 SPFX Accordion Webpart 中的 CKeditor 多个版本冲突
- ag-grid - Ag-grid 行拖放 - 无法读取未定义的属性“forEach”
- kotlin - 在kotlin中反射访问内部类Parent KType
- wpf - WPF ICommand 等效于 Click -= Button_Click
- c++ - 有没有办法只允许 C++ 中的最终类继承