首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ImageMapster“高亮显示”始终打开

ImageMapster“高亮显示”始终打开
EN

Stack Overflow用户
提问于 2019-01-15 18:01:07
回答 1查看 462关注 0票数 0

我使用jquery,ImageMapster和PHP。

脚本运行良好,如果我加载图像,我的区域是在,但当我移动我的mouseOver图像的高亮变化(正常),但…当我把我的mouseOut的img,我没有选择区域,并希望我的默认区域上。

我解决了这个问题,使用mouseOut调用始终相同的区域。我想做正确的事。

代码语言:javascript
复制
 <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'); 
EN

回答 1

Stack Overflow用户

发布于 2019-01-15 18:30:48

两天后,我终于找到了解决方案,在写了stackoverflow之后…

我必须设置一个区域。

代码语言:javascript
复制
 <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");        
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54196554

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档