JavaScript ͼÏñµØͼ
ͼÏñµØͼָµÄÊÇ´øÓпɵã»÷ÇøÓòµÄͼÏñ¡£
ʵÀý
¼òµ¥µÄ HTML ͼÏñÓ³Éä
±¾ÀýÑÝʾһ·ùûÓÐÌí¼Ó JavaScript µÄͼÏñÓ³Éä¡£
Ìí¼ÓÁË JavaScript µÄͼÏñÓ³Éä
±¾ÀýÑÝʾһ·ùÌí¼ÓÁË JavaScript µÄͼÏñÓ³É䣬µ±Êó±ê¸¡¶¯ÓÚij¸öÈȵãÉÏʱ£¬»áµ÷Óà JavaScript º¯ÊýÀ´ÏÔʾÈȵãËù¶ÔÓ¦µÄÐÇÇòµÄ¼ò½é¡£
JavaScript ͼÏñµØͼ
ÎÒÃÇÒѾ´Ó HTML ½Ì³ÌÖÐÁ˽⵽£¬Í¼ÏñµØͼÊÇ´øÓпɵã»÷ÇøÓòµÄͼÏñ¡£Í¨³£Çé¿öÏ£¬Ã¿¸öÇøÓòÊÇÒ»¸öÏà¹ØµÄ³¬¼¶Á´½Ó¡£µ¥»÷ij¸öÇøÓò£¬¾Í»Øµ½´ïÏà¹ØµÄÁ´½Ó¡£
ʵÀý
ÏÂÃæµÄÀý×ÓÑÝʾÈçºÎ´´½¨´øÓпɵã»÷ÇøÓòµÄ html ͼÏñµØͼ£º
<img src ="planets.gif" width ="145" height ="126"
alt="Planets"usemap ="#planetmap" />
<map id ="planetmap" name="planetmap">
<area shape ="rect" coords ="0,0,82,126" href ="sun.htm" target ="_blank"
alt="Sun" />
<area shape ="circle" coords ="90,58,3" href ="mercur.htm" target ="_blank"
alt="Mercury" />
<area shape ="circle" coords ="124,58,8" href ="venus.htm" target ="_blank"
alt="Venus" />
</map>
½á¹û
Ìí¼Ó JavaScript
ÎÒÃÇ¿ÉÏòͼÏñµØͼÄÚ²¿µÄ <area> ±êÇ©Ìí¼Ó£¨Äܵ÷ÓÃJavaScriptµÄ£©Ê¼þ¡£<area>
±êÇ©Ö§³ÖÒÔÏÂʼþ£ºonClick¡¢onDblClick¡¢onMouseDown¡¢onMouseUp¡¢onMouseOver¡¢
onMouseMove¡¢onMouseOut¡¢onKeyPress¡¢onKeyDown¡¢onKeyUp¡¢onFocusºÍonBlur¡£
ÕâÊÇÌí¼ÓÁË JavaScript µÄÉÏÃæµÄÀý×Ó£º
<html>
<head>
<script type="text/javascript">
function writeText(txt)
{
document.getElementById("desc").innerHTML=txt
}
</script>
</head>
<body>
<img src="planets.gif" width="145" height="126"
alt="Planets" usemap="#planetmap" />
<map id ="planetmap" name="planetmap">
<area shape ="rect" coords ="0,0,82,126"
onMouseOver
="writeText
('The Sun
Ïà¹ØÎĵµ£º
jQueryƬ¶Î£º
(function(){
//ÕâÀïºöÂÔjQueryËùÓÐʵÏÖ
})();
¡¡¡¡°ëÄêÇ°³õ´Î½Ó´¥jQueryµÄʱºò£¬ÎÒÒ²ÏñÆäËûÈËÒ»ÑùºÜÐ˷ܵØÏë¿´¿´Ô´ÂëÊÇʲôÑùµÄ¡£È»¶ø£¬ÔÚ¿´µ½Ô´ÂëµÄµÚÒ»ÑÛ£¬ÎÒ¾ÍÃÔºýÁË¡£ÎªÊ²Ã´Ö»ÓÐÒ»¸öÄäÃûº¯ÊýÓÖû¿´µ½ÔËÐУ¨µ±È»ÊÇÔËÐÐÁË……£©£¬¾ÍÄÜÓÐjQueryÕâô¸öº¯Êý¿âÁË£¿ÓÚÊÇ£¬ÎÒ±§×ÅÒÉÎÊÀ´µ½ ......
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ÎÞ±êÌâÒ³</title>
<mce:script language="javascript" type="te ......
ÔÎÄ£ºÁõÎä
| Javascript²Ù×÷ÏÂÀ¿òµÄ³£Ó÷½·¨
ÏîÄ¿ÖÐÅöµ½ÐèÒªÓÃjavascript²Ù×÷ÏÂÀ¿òµÄÇé¿ö£¬Ë³±ã×öÒ»ÏÂ×ܽᣬÁгöһЩ³£Ó÷½·¨£¬ÒÔÏ·½·¨¾ùÔÚFIRFOX3.5¼°IE8ÉϲâÊÔ¹ý£¬ÈçÓÐÆäËûä¯ÀÀÆ÷ÎÞ·¨Õý³£ÔËÐеÄÇëÓë±ÊÕßÁªÏµ¡£
//Ìí¼ÓÒ»¸öÏÂÀ¿ò
function AddDropDownList(id,fatherCtl)
{
if(!document.getElementById(id) ......
¡¡¡¡´ËÎÄΪ¶Á¡¶JavaScript And DHTML Cookbook¡·ºó×ܽá³öÀ´µÄ±Ê¼Ç¡£ÓÉÓÚµ±Ê±Êdzõѧ£¬ËùÒԱʼÇÖÐÄÑÃâÓдíÎ󣬻¶ÓÖ¸Õý¡£Ð»Ð»£¡
·×Ö·û´®(String)
1.ÉùÃ÷
var myString = new String("Every good boy does fine.");
var myString = "Every good boy does fine.";
&n ......
ÎÒÃÇ¿ÉÒÔʹÓà JavaScript À´´´½¨¶¯Ì¬µÄͼÏñ¡£
ʵÀý
°´Å¥¶¯»
ÀûÓÃÁ½¸ö²»Í¬µÄʼþÀ´Çý¶¯Á½¸öÏàÓ¦µÄº¯Êý£¬À´Çл»Á½ÕŶÔÓ¦µÄͼƬÒÔ´´Ôì³ö¶¯»Ð§¹û¡£
JavaScript ¶¯»
ʹÓà JavaScript ´´½¨¶¯Ì¬Í¼ÏñÊÇ¿ÉÐеġ£
ÇÏÃÅ
ÊÇ£ºÊ¹Óà JavaScript ͨ¹ý²»Í¬µÄʼþÀ´Çл»²»Í¬µÄͼÏñ¡£
ÔÚÏÂÃæµÄÀý×ÓÖУ¬ÎÒÃÇÒªÖÆ×÷Ò»¸ö³äµ±Á ......