нужна консультация по javascript - вопрос №903084

<strong>Нужно вместо ===!!!(123)!!!=== в коде вставить ссылку на картинку</strong>  <div id="veg_demo" style="width:100%; margin: auto;"><br /> <p>Simple example demonstrating <b>singleClick</b> which permits only one area to be selected, and changing a tooltip on the fly.<br /> the dip has a tooltip, which is different if asparagus is selected. This also shows how to use area-specific options to control<br /> the styling of each area individually.Some areas use different colors for selection to ensure that the highlight is visible<br /> even though each area is a substantially different color.<br /><br /> </p><br /> <div style="clear:both;"><br /><img id="veg" src="/sites/default/files/pic/plans/Plan site.jpg" usemap="#veg" ><br /> </div><br /> <div style="clear:both; height:8px;"></div><br /> <div id="selections" style="clear:both;"></div><br /></div><br /><br /><br /><br /><script type="text/javascript"><br /><br />$(document).ready(function () {<br /> var image = $('img');<br /> var xref = {<br /> redpepper: "<b>Red peppers</b> are actually the same as green peppers, they've just been left on the vine longer. Delicious when fire-roasted. <strong>===!!!(123)!!!===</strong>",<br /> carrots: "<b>Carrots</b> are delicious and may turn your skin orange!",<br /> asparagus: "<b>Asparagus</b> is one of the first vegetables of the spring. Being a dark green, it's great for you, and has interesting side effects.",<br /> squash: "<b>Squash</b> is a winter vegetable, and not eaten raw too much. Is that really squash?",<br /> yellowpepper: "Similar to red peppers, <b>yellow peppers</b> are sometimes sweeter.",<br /> celery: "<b>Celery</b> is a fascinating vegetable. Being mostly water, it actually takes your body more calories to process it than it provides.",<br /> cucumbers: "<b>Cucumbers</b> are cool.",<br /> broccoli: "<b>Broccoli</b> is like a forest of goodness in your mouth. And very good for you. Eat lots of broccoli!",<br /> dip: "Everything here is good for you but this one. <b>Don't be a dip!</b>"<br /> };<br /> var defaultDipTooltip = 'I know you want the dip. But it\'s loaded with saturated fat, just skip it and enjoy as many delicious, crisp vegetables as you can eat.';<br /><br /> image.mapster(<br /> {<br /> fillOpacity: 0.4,<br /> fillColor: "d42e16",<br /> strokeColor: "3320FF",<br /> strokeOpacity: 0.8,<br /> strokeWidth: 4,<br /> stroke: true,<br /> isSelectable: true,<br /> singleSelect: true,<br /> mapKey: 'name',<br /> listKey: 'name',<br /> onClick: function (e) {<br /> var newToolTip = defaultDipTooltip;<br /> $('#selections').html(xref[e.key]);<br /> if (e.key==='asparagus') {<br /> newToolTip = "OK. I know I have come down on the dip before, but let's be real. Raw asparagus without any of that " + "delicious ranch and onion dressing slathered all over it is not so good.";<br /> }<br /> image.mapster('set_options',{areas: [{<br /> key: "dip",<br /> toolTip: newToolTip<br /> }]<br /> });<br /> },<br /> showToolTip: true,<br /> toolTipClose: ["tooltip-click", "area-click"],<br /> areas: [<br /> {<br /> key: "redpepper",<br /> fillColor: "ffffff"<br /> },<br /> {<br /> key: "yellowpepper",<br /> fillColor: "000000"<br /> },<br /> {<br /> key: "carrots",<br /> fillColor: "000000"<br /> },<br /> {<br /> key: "dip",<br /> toolTip: defaultDipTooltip<br /> },<br /> {<br /> key: "asparagus",<br /> strokeColor: "FFFFFF"<br /> }<br /> ]<br /> });<br /> });<br /> </script><br /> <map id="veg_map" name="veg"><br /> <area shape="poly" name="redpepper" coords="207, 166, 117, 166, 117, 121, 97, 121, 96, 11, 205, 11" href="/plans/flat/1"><br /> <area shape="poly" name="celery" coords="147,131, 156,143, 163,146, 177,129, 175,138, 177,138, 182,144, 180,164, 148,169, 139,171, 144,180, 141,198, 139,208, 140,222, 127,237, 148,216, 163,212, 166,216, 160,223, 163,233, 153,281, 135,318, 129,313, 122,322, 117,320, 99,301, 98,293, 85,300, 80,303, 74,300,<br /> 64,285, 76,272, 98,249,<br /> 94,246, 72,261, 57,258, 62,251, 60,248, 47,228, 51,207, 71,195, 72,192, 38,202, 33,195, 30,173, 147,127" href="#"><br /> <area shape="poly" name="carrots" coords="175,74, 170,80, 154,85, 189,103, 190,111, 182,111, 179,98, 157,95, 142,111, 140,128, 38,169, 39,163, 74,143, 74,141, 56,135, 52,115, 79,111, 78,106, 63,98, 71,91, 81,88, 82,83, 91,75, 136,74, 174,70" href="#"><br /> <area shape="poly" name="asparagus" coords="224,25, 239,33, 244,36, 247,32, 327,23, 344,31, 343,36, 319,41, 315,42, 302,52, 272,61, 265,64, 270,73, 256,67, 248,60, 187,55, 192,58, 192,60, 184,64, 185,67, 176,67, 173,69, 142,67, 146,63, 135,59, 123,57, 142,44, 145,42, 143,39, 145,32, 207,38, 185,18, 212,19,<br /> 220,22" href="#"><br /> <area shape="poly" name="squash" coords="388,26, 391,38, 394,43, 395,46, 425,58, 427,68, 428,92, 386,125, 371,132, 374,124, 377,118, 374,105, 371,105, 370,107, 364,102, 368,97, 356,87, 353,89, 348,86, 322,87, 314,100, 314,102, 282,85, 278,84, 273,74, 272,68, 319,46, 346,31" href="#"><br /> <area shape="poly" name="yellowpepper" coords="237,222, 246,254, 255,291, 262,323, 271,322, 285,350, 306,352, 307,365, 298,374, 285,366, 270,375, 249,378, 244,384, 231,389, 215,373, 210,363, 203,357, 199,368, 184,361, 175,349, 162,356, 140,340, 143,305, 161,252, 168,224, 188,240, 194,223, 198,232, 213,226, 224,224,<br /> 229,218" href="#"><br /> <area shape="poly" name="broccoli" coords="341,89, 342,91, 360,95, 353,100, 360,104, 364,109, 368,115, 369,112, 367,110, 376,111, 373,123, 367,128, 362,128, 359,131, 348,134, 345,137, 340,138, 341,148, 334,167, 323,172, 315,165, 315,162, 312,165, 311,172, 293,167, 292,141, 298,136, 307,134, 322,129, 328,128,<br /> 329,116, 319,109, 314,104,<br /> 317,93, 332,84" href="#"><br /> <area shape="poly" name="broccoli" coords="328,178, 338,197, 337,202, 330,215, 328,217, 325,228, 307,234, 305,239, 287,225, 287,216, 286,212, 282,216, 277,212, 277,185, 284,179, 310,175" href="#"><br /> <area shape="poly" name="dip" coords="253,102, 277,100, 280,105, 290,107, 295,111, 304,130, 290,140, 287,147, 240,157, 238,159, 227,153, 203,146, 198,125, 200,116, 214,102, 231,102" href="#"><br /><br /> </map>

Ответы

копирайт? тогда в коде © (пишите без звёздочек                         &*c*o*p*y*;                         )
03.05.16

Alexander

Читать ответы
Посмотреть всех экспертов из раздела Технологии > JavaScript,Ajax,HTML
Пользуйтесь нашим приложением Доступно на Google Play Загрузите в App Store