Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

HTMLÄÚ²¿ÔªËصÄMouseʼþ¸ÉÈÅ

½â¾öHTMLÄÚ²¿ÔªËصÄMouseʼþ¸ÉÈÅ
½â¾öHTMLÄÚ²¿ÔªËصÄMouseʼþ¸ÉÈÅ
»°ËµÓÐÒ»¸öDIVÔªËØ£¬ÆäÄÚ²¿ÓÐÒ»¸öIMGÔªËغÍSPANÔªËØ£¬²»ÓÃÀí»áÕâÁ½¸öÄÚ²¿ÔªËØÔõô²¼¾Ö£¬Õâ²»ÊÇÎÒÒªÌÖÂÛµÄÖص㡣
ΪÁËʵÏÖһЩÌØÊâµÄЧ¹û£¬ÎÒÐèÒªÀûÓÃTDµÄonmouseoverºÍonmouseoutʼþ£¬²âÊÔʱ¾Í»á·¢ÏÖÈçϵÄ×´¿ö£º
µ±Êó±êÒÆÈëDIVÄÚ²¿Ê±£¬onmouseoverʼþ±»´¥·¢£»½Ó×ÅÔÙÊó±êÒƶ¯µ½DIVÄÚ²¿µÄIMG»òÕßSPANÔªËØÖ®ÉÏ£¬ÎÒÃǿ϶¨²»»áÈÏΪÕâʱÊó±êÒѾ­ÒƵ½ÁËDIVµÄÍâ±ß£¬µ«Ææ¹ÖµÄÊÇonmouseoutʼþ´¥·¢ÁË£¬¶øÇÒ½ô½Ó×ÅonmouseoverʼþÒ²ÂíÉϱ»´¥·¢ÁË¡£
Õâ¿É²»ÊÇÎÒÏëÒªµÄ£¬ÄÇôÔõôÀ´“ÆÁ±Î”ÄÚ²¿ÔªËظøÍâ²ãÔªËØ´øÀ´µÄJavascriptʼþ¸ÉÈÅÄØ£¿
ÕâÀïÁоÙÁ½ÖÖ·½·¨£º
Ò». setTimeout
ÒòΪÔÚÊó±êÒƶ¯µ½ÄÚ²¿ÔªËØÖ®É϶ø´¥·¢ÁËÍâ²ãÔªËصÄonmouseoutʼþºó£¬Íâ²ãÔªËصÄonmouseoverÒ²»áÂíÉÏ´¥·¢£¬ËùÒÔÎÒÃÇÖ»ÐèÒª°ÑÍâ²ãÔªËصÄonmouseoutʼþÐèÒªÖ´ÐеĶ¯×÷Ñӳٺ̵ܶÄÒ»¶Îʱ¼äÀ´ÔËÐУ¬È»ºóÔÚonmouseoverʼþÖÐÔÙÖ´ÐÐclearTimeout·½·¨£¬ÕâÑù¾Í¿ÉÒÔ±ÜÃâÄÚ²¿ÔªËØÒýÆðµÄʼþ¸ÉÈÅ¡£
¾ßÌåµÄÖ´Ðйý³ÌÇë¿´ÏÂͼ£¨×ÝÏòµÄÐéÏß±íʾʱ¼ä£©£º
 
ÕâÊǸöºÜÇÉÃîµÄµÄ·½·¨£¬ÒòΪµ±onmouseout´¥·¢ºó£¬ÊµÖÊÐԵķ½·¨²¢Ã»ÓÐÂíÉÏÖ´ÐУ¬¶øÊÇÒªµÈ´ýһС¶Îʱ¼ä¡£Èç¹ûÔÚÕâ¶Îʱ¼äÀïÂíÉÏÓÖ´¥·¢ÁË onmouseoverʼþ£¬ÄÇô»ù±¾ÉϾͿÉÒԿ϶¨onmouseoutʼþµÄ´¥·¢ÊÇÒòΪÄÚ²¿ÔªËصĸÉÈÅÁË£¬ËùÒÔÔÚonmouseoverʼþÖÐʹÓà clearTimeoutÀ´×èÖ¹ÑÓʱµÄ·½·¨Ö´ÐС£
¶þ.contains
ÔÚonmouseoverʱÏȽøÐÐÈçÏÂÅжϣ¬½á¹ûΪtrueʱÔÙÖ´Ðз½·¨Ì壺
var s = e.fromElement || e.relatedTarget ;
if(!this.contains(s)){MouseOverFunc()}
ÔÚonmouseoutʱÏȽøÐÐÈçÏÂÅжϣ¬½á¹ûΪtrueʱÔÙÖ´Ðз½·¨Ì壺
var s = e.toElement || e.relatedTarget ;
if(!this.contains(s)){MouseOutFunc()}
 
ÏÂÃæÀ´½âÊÍÒ»ÏÂÉÏÃæÁ½ÐдúÂëµÄº¬Ò壺
ÔÚIEÖУ¬ËùÓеÄHTMLÔªËض¼ÓÐÒ»¸öcontains·½·¨£¬ËüµÄ×÷ÓÃÊÇÅжϵ±Ç°ÔªËØÄÚ²¿ÊÇ·ñ°üº¬Ö¸¶¨µÄÔªËØ¡£ÎÒÃÇÀûÓÃÕâ¸ö·½·¨À´ÅжÏÍâ²ãÔªËصÄʼþÊDz»ÊÇÒòΪÄÚ²¿ÔªËضø±»´¥·¢£¬Èç¹ûÄÚ²¿ÔªËص¼ÖÂÁ˲»ÐèÒªµÄʼþ±»´¥·¢£¬ÄÇÎÒÃǾͺöÂÔÕâ¸öʼþ¡£
event.fromElementÖ¸Ïò´¥·¢onmouseoverºÍonmouseoutʼþʱÊó±êÀ뿪µÄÔªËØ£»event.toElementÖ¸Ïò´¥·¢onmouseoverºÍonmouseoutʼþʱÊó±ê½øÈëµÄÔªËØ¡£
ÄÇôÉÏÃæÁ½ÐдúÂëµÄº¬Òå¾Í·Ö±ðÊÇ£º
¡ð µ±´¥·¢onmouseoverʼþʱ£¬ÅжÏÊó±êÀ뿪µÄÔª


Ïà¹ØÎĵµ£º

Javascript ÖжÔHTML±àÂëºÍ½âÂëµÄ·½·¨

String.prototype.HTMLEncode = function() {
var temp = document.createElement ("div");
(temp.textContent != null) ? (temp.textContent = this) : (temp.innerText = this);
var output = temp.innerHTML;
temp = null;
return output;
}
String.prototype.HTMLDecode = function() {
var temp = doc ......

½â¾öjson°üº¬html±êÇ©ÎÞ·¨ÏÔʾµÄÎÊÌâ

Ö÷ÒªÊǽ«jsonÎÞ·¨Ê¶±ðµÄ×Ö·û½øÐÐתÒå   
function dotran($str) {
        $str = str_replace('"','\\"',$str);
        $str = str_replace("\r\n",'\\r\\n',$str);
        $str = str_ ......

aspÏÂÔØÆäËüÍøÕ¾µÄͼƬÀ´¸øhtmlÏÔʾ

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Option Explicit
Response.Buffer = True '»º´æͼƬ
Dim objXMLHTTP, XML
Set XML = Server.CreateObject("Microsoft.XMLHTTP") '½¨Á¢ÏÂÔضÔÏó
XML.Open "GET","http://www.google.cn/images/nav_logo7.png",False '¿ªÊ¼»ñȡͼƬ,http://xxx/pngÕâ½Ú¿ÉÒԸijÉ× ......

HTML 5ͨ¹ýsandboxÊôÐÔÌáÉýiFrameµÄ°²È«ÐÔ

ת×Ô£ºInfoQ
×÷Õß




Abel Avram




ÒëÕß

ÕÅÁú

·¢²¼ÓÚ
2010Äê1ÔÂ30ÈÕ ÉÏÎç12ʱ6·Ö

Ä¿Ç°Web Hypertext Application
Technology Working Group
£¨WHATWG£©ÕýÓëW3C
ͨ
Á¦ºÏ×÷½¨Á¢HTML 5±ê×¼£¬ÔÚ¹ýÈ¥3¸öÔÂÖÐ ......

8±¾¾­µäHtmlµç×ÓÊé


Teach Yourself Visually Html And CSS

Pro CSS and HTML Design Patterns

JavaScript and DHTML Cookbook 2nd Edition

The Right Way Using HTML & CSS

ÍøÒ³ÖÆ×÷ÍêÈ«ÊÖ²á

HeadFirst HTM ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ