Javascript 我的图像映射不起作用,但它看起来很像演示映射

Javascript 我的图像映射不起作用,但它看起来很像演示映射,javascript,html,tooltip,highlight,imagemapster,Javascript,Html,Tooltip,Highlight,Imagemapster,我想使用ImageMapster高亮显示图像的各个部分,并在光标位于特定区域上时显示工具提示。我在ImageMapster站点上进行了演示,并使用clean USA地图的JSFIDLE来测试我的想法,即如何让部分高亮显示和显示工具提示 }) 但是当我把它应用到我自己的图像上时,我根本没有得到任何突出显示 $('img').mapster({ mapKey: 'name', singleSelect: true, showToolTip: true, toolTipClose: ["area-mo

我想使用ImageMapster高亮显示图像的各个部分,并在光标位于特定区域上时显示工具提示。我在ImageMapster站点上进行了演示,并使用clean USA地图的JSFIDLE来测试我的想法,即如何让部分高亮显示和显示工具提示

})

但是当我把它应用到我自己的图像上时,我根本没有得到任何突出显示

$('img').mapster({
mapKey: 'name',
singleSelect: true,
showToolTip: true,
toolTipClose: ["area-mouseout"],
areas: [{
    key: "animal_waste",
    toolTip: "<b>Animal waste</b> contains nitrogen in an organic form, such as nitrates and urea."
}, {
    key: "atmosphere",
    toolTip: "The <b>atmosphere</b> is 78% nitrogen. But atmospheric nitrogen is not readily available for biological purposes. It needs to be 'fixed' into a form that plants and animals can use. Lightning 'fixes' nitrogen by combining nitrogen with water to form ammonia and nitrates."
}, {
    key: "dead",
    toolTip: "When <b>plants and animals die</b>, decomposers (mainly fungi and bacteria) break down proteins to release the nitrogen from amino acids into the larger environment."
}, {
    key: "fertilizers",
    toolTip: "Humans can make <b>fertilizers</b> from animal waste, which is rich in 'fixed' nitrogen, or they can 'fix' the nitrogen through the Haber-Bosch process, which uses high pressure to force the reaction of nitrogen with hydrogen to make ammonia."
}, {
    key: "groundwater",
    toolTip: "Nitrogen, in the form of nitrites, nitrates, or ammonia, can get into <b>groundwater</b> when fertilizers or animal waste leach through the overlying soil."
}, {
    key: "live_animals",
    toolTip: "<b>Animals</b> incorporate the nitrogen they consume into amino acids that make up the proteins in their bodies."
}, {
    key: "live_plants",
    toolTip: "<b>Plants</b> take up 'fixed' nitrogen from the soil. Some plants, called legumes (including peas, beans, alfalfa, and clover) contain symbiotic bacteria in their root nodules; these bacteria can 'fix' nitrogen from the air into a form that the plants can use. Plants incorporate nitrogen into amino acids that make up the proteins in their bodies."
}, {
    key: "ocean",
    toolTip: "Nitrogen can move into the <b>ocean</b> through runoff from the soil, inflow from surface water, percolation of groundwater, or from the waste materials of plants and animals living in the ocean."
}, {
    key: "rainwater",
    toolTip: "<b>Rainwater</b> can deliver nitrogen by picking up 'fixed' nitrogen from the atmosphere. 'Fixed' nitrogen in the atmosphere can come from lightning strikes or from pollutant emissions of nitrogen oxides."
}, {
    key: "soils",
    toolTip: "<b>Soils</b> support the growth of several species of bacteria and fungi that convert nitrogen into different chemical forms. Some of these organisms 'fix' nitrogen into biologically useful forms, such as ammonia, nitrites, and nitrates. Others denitrify, reducing the nitrites and nitrates into gaseous nitrogen that can be released into the atmosphere."
}, {
    key: "surface_water",
    toolTip: "Nitrogen can move into <b>surface water</b> through runoff from the soil, percolation up from the groundwater, or from the waste materials of plants and animals growing in the water."
}]
})

我使用MapSpinner进行映射并获得坐标


从比较我的html和演示html来看,一切都应该正常。任何帮助都将不胜感激。谢谢大家!

您必须将映射的名称设置为与usemap的值相同。现在您将Ncycle作为映射名称,而不是映射的_cycle。谢谢,我真不敢相信我错过了!
$('img').mapster({
mapKey: 'name',
singleSelect: true,
showToolTip: true,
toolTipClose: ["area-mouseout"],
areas: [{
    key: "animal_waste",
    toolTip: "<b>Animal waste</b> contains nitrogen in an organic form, such as nitrates and urea."
}, {
    key: "atmosphere",
    toolTip: "The <b>atmosphere</b> is 78% nitrogen. But atmospheric nitrogen is not readily available for biological purposes. It needs to be 'fixed' into a form that plants and animals can use. Lightning 'fixes' nitrogen by combining nitrogen with water to form ammonia and nitrates."
}, {
    key: "dead",
    toolTip: "When <b>plants and animals die</b>, decomposers (mainly fungi and bacteria) break down proteins to release the nitrogen from amino acids into the larger environment."
}, {
    key: "fertilizers",
    toolTip: "Humans can make <b>fertilizers</b> from animal waste, which is rich in 'fixed' nitrogen, or they can 'fix' the nitrogen through the Haber-Bosch process, which uses high pressure to force the reaction of nitrogen with hydrogen to make ammonia."
}, {
    key: "groundwater",
    toolTip: "Nitrogen, in the form of nitrites, nitrates, or ammonia, can get into <b>groundwater</b> when fertilizers or animal waste leach through the overlying soil."
}, {
    key: "live_animals",
    toolTip: "<b>Animals</b> incorporate the nitrogen they consume into amino acids that make up the proteins in their bodies."
}, {
    key: "live_plants",
    toolTip: "<b>Plants</b> take up 'fixed' nitrogen from the soil. Some plants, called legumes (including peas, beans, alfalfa, and clover) contain symbiotic bacteria in their root nodules; these bacteria can 'fix' nitrogen from the air into a form that the plants can use. Plants incorporate nitrogen into amino acids that make up the proteins in their bodies."
}, {
    key: "ocean",
    toolTip: "Nitrogen can move into the <b>ocean</b> through runoff from the soil, inflow from surface water, percolation of groundwater, or from the waste materials of plants and animals living in the ocean."
}, {
    key: "rainwater",
    toolTip: "<b>Rainwater</b> can deliver nitrogen by picking up 'fixed' nitrogen from the atmosphere. 'Fixed' nitrogen in the atmosphere can come from lightning strikes or from pollutant emissions of nitrogen oxides."
}, {
    key: "soils",
    toolTip: "<b>Soils</b> support the growth of several species of bacteria and fungi that convert nitrogen into different chemical forms. Some of these organisms 'fix' nitrogen into biologically useful forms, such as ammonia, nitrites, and nitrates. Others denitrify, reducing the nitrites and nitrates into gaseous nitrogen that can be released into the atmosphere."
}, {
    key: "surface_water",
    toolTip: "Nitrogen can move into <b>surface water</b> through runoff from the soil, percolation up from the groundwater, or from the waste materials of plants and animals growing in the water."
}]