首页 > 解决方案 > 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'); 

标签: javascriptjqueryimagemapster

解决方案


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");        

推荐阅读