{"id":41,"date":"2007-07-25T00:28:11","date_gmt":"2007-07-25T04:28:11","guid":{"rendered":"http:\/\/prglab.com\/blog\/js-tutorial\/js-imagemaps"},"modified":"2007-07-25T00:46:48","modified_gmt":"2007-07-25T04:46:48","slug":"js-imagemaps","status":"publish","type":"page","link":"https:\/\/www.prglab.com\/blog\/js-tutorial\/js-imagemaps","title":{"rendered":"JavaScript Image Maps"},"content":{"rendered":"<p>image-map\u662f\u4e00\u5f20\u5e26\u53ef\u70b9\u51fb\u533a\u57df\u7684\u56fe\u7247\u3002<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nHTML Image Maps<\/p>\n<p>image-map\u662f\u4e00\u5f20\u5e26\u53ef\u70b9\u51fb\u533a\u57df\u7684\u56fe\u7247\uff0c\u901a\u5e38\u6bcf\u4e00\u4e2a\u533a\u57df\u662f\u4e00\u4e2a\u8d85\u7ea7\u94fe\u63a5\uff0c\u70b9\u51fb\u8fd9\u4e2a\u533a\u57df\u53ef\u4ee5\u8bbf\u95ee\u76f8\u5e94\u7684\u94fe\u63a5\u3002<\/p>\n<p><strong>\u4f8b\u5b50<\/strong><\/p>\n<table class=\"ex\" border=\"1\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td valign=\"top\">\n<pre>&lt;img src =\"planets.gif\"\r\nwidth =\"145\" height =\"126\"\r\nalt=\"Planets\"\r\nusemap =\"#planetmap\" \/&gt;<\/pre>\n<pre>&lt;map id =\"planetmap\"\r\nname=\"planetmap\"&gt;\r\n&lt;area shape =\"rect\" coords =\"0,0,82,126\"\r\n  href =\"sun.htm\" target =\"_blank\"\r\n  alt=\"Sun\" \/&gt;\r\n&lt;area shape =\"circle\" coords =\"90,58,3\"\r\n  href =\"mercur.htm\" target =\"_blank\"\r\n  alt=\"Mercury\" \/&gt;\r\n&lt;area shape =\"circle\" coords =\"124,58,8\"\r\n  href =\"venus.htm\" target =\"_blank\"\r\n  alt=\"Venus\" \/&gt;\r\n&lt;\/map&gt;<\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<p><strong>\u6548\u679c\u6f14\u793a<\/strong><\/p>\n<p><img loading=\"lazy\" src=\"http:\/\/prglab.com\/blog\/wp-content\/uploads\/planets.gif\" alt=\"Planets\" usemap=\"#planetmap\" height=\"126\" width=\"145\" \/><\/p>\n<map id=\"planetmap\" name=\"planetmap\">\n<area href=\"sun.htm\" shape=\"rect\" coords=\"0,0,82,126\" target=\"_blank\" alt=\"Sun\" \/>\n<area href=\"mercur.htm\" shape=\"circle\" coords=\"90,58,3\" target=\"_blank\" alt=\"Mercury\" \/>\n<area href=\"venus.htm\" shape=\"circle\" coords=\"124,58,8\" target=\"_blank\" alt=\"Venus\" \/> <\/map>\n<p><strong>\u589e\u52a0\u4e00\u4e9bJavaScript\u4ee3\u7801<\/strong><\/p>\n<p>\u6211\u4eec\u53ef\u4ee5\u5728image map\u7684<br \/>\n\u6807\u7b7e\u4e0a\u589e\u52a0\u4e00\u4e9b\u4e8b\u4ef6\u6765\u8c03\u7528JavaScript\u7684\u51fd\u6570\u3002<br \/>\n\u6807\u7b7e\u652f\u6301\u7684\u4e8b\u4ef6\u6709onClick, onDblClick, onMouseDown, onMouseUp, onMouseOver, onMouseMove, onMouseOut, onKeyPress, onKeyDown, onKeyUp, onFocus, \u548conBlur\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u5728\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\u589e\u52a0\u4e86\u4e00\u4e9bJavaScript\uff1a<\/p>\n<table class=\"ex\" id=\"table14\" border=\"1\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td valign=\"top\">\n<pre>&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;script type=\"text\/javascript\"&gt;\r\nfunction writeText(txt)\r\n{\r\ndocument.getElementById(\"desc\").innerHTML=txt\r\n}\r\n&lt;\/script&gt;\r\n&lt;\/head&gt;<\/pre>\n<pre>&lt;body&gt;\r\n&lt;img src=\"planets.gif\" width=\"145\" height=\"126\"\r\nalt=\"Planets\" usemap=\"#planetmap\" \/&gt;\r\n\r\n&lt;map id =\"planetmap\" name=\"planetmap\"&gt;\r\n&lt;area shape =\"rect\" coords =\"0,0,82,126\"\r\nonMouseOver=\"writeText('The Sun and the gas giant\r\nplanets like Jupiter are by far the largest objects\r\nin our Solar System.')\"\r\nhref =\"sun.htm\" target =\"_blank\" alt=\"Sun\" \/&gt;\r\n\r\n&lt;area shape =\"circle\" coords =\"90,58,3\"\r\nonMouseOver=\"writeText('The planet Mercury is very\r\ndifficult to study from the Earth because it is\r\nalways so close to the Sun.')\"\r\nhref =\"mercur.htm\" target =\"_blank\" alt=\"Mercury\" \/&gt;\r\n\r\n&lt;area shape =\"circle\" coords =\"124,58,8\"\r\nonMouseOver=\"writeText('Until the 1960s, Venus was\r\noften considered a twin sister to the Earth because\r\nVenus is the nearest planet to us, and because the\r\ntwo planets seem to share many characteristics.')\"\r\nhref =\"venus.htm\" target =\"_blank\" alt=\"Venus\" \/&gt;\r\n&lt;\/map&gt; \r\n\r\n&lt;p id=\"desc\"&gt;&lt;\/p&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<hr \/>\n<p> <a href=\"http:\/\/www.w3schools.com\/js\/js_animation.asp\"><\/a>  <\/p>\n<map id=\"planetmap\" name=\"planetmap\">\n<area href=\"sun.htm\" shape=\"rect\" coords=\"0,0,82,126\" onmouseover=\"writeText('The Sun and the gas giant planets like Jupiter are by far the largest objects in our Solar System.')\" target=\"_blank\" alt=\"Sun\" \/>\n<area href=\"mercur.htm\" shape=\"circle\" coords=\"90,58,3\" onmouseover=\"writeText('The planet Mercury is very difficult to study from the Earth because it is always so close to the Sun.')\" target=\"_blank\" alt=\"Mercury\" \/>\n<area href=\"venus.htm\" shape=\"circle\" coords=\"124,58,8\" onmouseover=\"writeText('Until the 1960s, Venus was often considered a twin sister to the Earth because Venus is the nearest planet to us, and because the two planets seem to share many characteristics.')\" target=\"_blank\" alt=\"Venus\" \/> <\/map>\n<p id=\"desc\">&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>image-map\u662f\u4e00\u5f20\u5e26\u53ef\u70b9\u51fb\u533a\u57df\u7684\u56fe\u7247\u3002 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; HTML Image Maps image-map\u662f\u4e00\u5f20\u5e26\u53ef\u70b9\u51fb\u533a\u57df\u7684\u56fe\u7247\uff0c\u901a\u5e38\u6bcf\u4e00\u4e2a\u533a\u57df\u662f\u4e00\u4e2a\u8d85\u7ea7\u94fe\u63a5\uff0c\u70b9\u51fb\u8fd9\u4e2a\u533a\u57df\u53ef\u4ee5\u8bbf\u95ee\u76f8\u5e94\u7684\u94fe\u63a5\u3002 \u4f8b\u5b50 &lt;img src =&#8221;planets.gif&#8221; width =&#8221;145&#8243; height =&#8221;126&#8243; alt=&#8221;Planets&#8221; usemap =&#8221;#planetmap&#8221; \/&gt; &lt;map id =&#8221;planetmap&#8221; name=&#8221;planetmap&#8221;&gt; &lt;area shape =&#8221;rect&#8221; coords =&#8221;0,0,82,126&#8243; href =&#8221;sun.htm&#8221; target =&#8221;_blank&#8221; alt=&#8221;Sun&#8221; \/&gt; &lt;area shape =&#8221;circle&#8221; coords =&#8221;90,58,3&#8243; href =&#8221;mercur.htm&#8221; target =&#8221;_blank&#8221; alt=&#8221;Mercury&#8221; \/&gt; &lt;area shape =&#8221;circle&#8221; coords =&#8221;124,58,8&#8243; href =&#8221;venus.htm&#8221; target =&#8221;_blank&#8221; alt=&#8221;Venus&#8221; \/&gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3,"menu_order":29,"comment_status":"open","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/pages\/41"}],"collection":[{"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":0,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/pages\/41\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/pages\/3"}],"wp:attachment":[{"href":"https:\/\/www.prglab.com\/blog\/wp-json\/wp\/v2\/media?parent=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}