ImageMapster突出显示.ready()上的所有区域

ImageMapster highlight all areas on .ready()

本文关键字:区域 显示 ready ImageMapster      更新时间:2023-09-26

我在解决一个简单的问题时遇到了困难。

当页面到达.onready()时,我需要突出显示图像上的所有区域。

这是我正在使用的代码…但是这行不通。

   $(document).ready(function(e){
                    for(var area in areas) {
                            $(this).mapster('highlight', areas[area].key);
                                    }
                        });

我使用这个ImageMapster插件

尝试使用每个循环:

jQuery.each(areas, function(key, value) {
     $(this).mapster('highlight', key);
});

我不知道我们从区域得到了什么数据,你可以尝试在每个循环中添加console,看看我们在key中得到了什么和它的值