当前位置: 动力学知识库 > 问答 > 编程问答 >

jquery - highlight all areas in imagemapster without any click or action

问题描述:

So I am using imagemapster to map my image and I want to show all the selectable areas to the user without them needing to scroll over the image to find which areas are selectable. I am attaching my code in the js file. help.

var $bone_map, $body_map, bone_default_options, body_default_options;

$bone_map = $('#skeleton_image');

function boneBuildAreas() {

var items = $('#boneMap').find('area');

var areaArray = [];

items.each(function () {

var fullName = $(this).attr('bone');

areaArray.push({ key: fullName, toolTip: buildToolTipArea(fullName), highlight: true });

});

return areaArray;

}

function buildToolTipArea(fullName) {

return $('<div>' + fullName + '</div>');

}

bone_default_options =

{

fillOpacity: 0.5,

render_highlight: {

fillColor: '22ff00',

stroke: true

},

render_select: {

fillColor: 'ff000c',

stroke: false

},

fadeInterval: 50,

isSelectable: true,

singleSelect: true,

mapKey: 'bone',

showToolTip: true,

toolTipClose: ['area-mouseout', 'tooltip-click', 'area-click'],

areas: boneBuildAreas()

};

$bone_map.mapster(bone_default_options);

分享给朋友:
您可能感兴趣的文章:
随机阅读: