µãµãµÎµÎ(JavaScript)
½ûֹѡÔñ
unselectable="on"(off): IE/Opera
style="-moz-user-select:none": FireFox(JS:element.style.MozUserSelect = "none";)
style="-khtml-user-select:none": Safari(JS:element.style.KhtmlUserSelect)
onselectstart="return false": IE
È¡ÏûÑ¡Ôñ
if(document.selection && document.selection.clear) document.selection.clear(); // IE
else if(window.getSelection && window.getSelection().removeAllRanges) window.getSelection().removeAllRanges(); // FireFox/Opera/Safari
µ±Ç°½¹µãÊÇÄĸö¿Ø¼þ
document.activeElement // IE, FF3.0+
»ñÈ¡ÑùʽµÄʵ¼ÊÊôÐÔÖµ
IE: ¶ÔÏó.currentStyle.ÐèÒª·ÃÎʵÄÊôÐÔ
W3C: window.getComputedStyle("¶ÔÏó",null).ÐèÒª·ÃÎʵÄÊôÐÔ(µÚ2¸ö²ÎÊýΪαԪËØ,Èç:hover,:first-letter,:beforeµÈ,ÊDZØÐëµÄ)
function getStyle(element, style){
var strValue = "";
if(document.defaultView && document.defaultView.getComputedStyle){
strValue = document.defaultView.getComputedStyle(element, "").getPropertyValue(strCssRule);
}
else if(element.currentStyle){
strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
return p1.toUpperCase();
});
strValue = element.currentStyle[strCssRule];
}
&
Ïà¹ØÎĵµ£º
×î½üÕâ¶Îʱ¼äÒ»Ö±ÔÚ¸ãÇ°¶ËJavaScript£¬ÒÔÇ°×ܾõµÃJSûʲô¸ãÍ·£¬¾¹ýÕâÒ»¶ÎµÄÓ¦Ó㬲ŷ¢ÏÖJsÀïÃæµÄ¶«Î÷ÕæµÄºÜÉîºÜÉîµÄ£¬²»È»ÎªÊ²Ã´¸÷´óÃÅ»§ÍøÕ¾¶¼ÕÐÒ»ÅúJS¹¤³ÌʦÄØ¡£
Ïл°²»Ëµ£¬ÏÖÔÚ¿´¿´JavaScript
ÀïµÄ±Õ°ü
¡£
Òª³ÉΪ¸ß¼¶ JavaScript ³ÌÐòÔ± ......
nodeName
nodeName ÊôÐÔº¬ÓÐij¸ö½ÚµãµÄÃû³Æ¡£
ÔªËؽڵãµÄ nodeName ÊDZêÇ©Ãû³Æ
ÊôÐÔ½ÚµãµÄ nodeName ÊÇÊôÐÔÃû³Æ
Îı¾½ÚµãµÄ nodeName ÓÀÔ¶ÊÇ #text
Îĵµ½ÚµãµÄ nodeName ÓÀÔ¶ÊÇ #document
×¢ÊÍ£ºnodeName Ëù°üº¬µÄ XML ÔªËصıêÇ©Ãû³ÆÓÀÔ¶ÊÇ´óдµÄ
nodeValue
¶ÔÓÚÎı¾½Úµã£¬nodeValue ÊôÐÔ°üº¬Îı¾¡£
¶ÔÓÚÊô ......
JavaScript »ñȡʼþ¶ÔÏóµÄÒ»¸ö×¢Òâµã
2009-7-24 ÉÏÎç
- JS/Ajax/AS/Flex
- event
- javascript
ƽʱÎÒÃÇ»ñȡʼþ¶ÔÏóÒ»°ãд·¨ÈçÏ£º
function
getEvent
(
event
)
{
return
event
||
window
.
event
// IE:window.event
}
Èç¹ûûÓвÎÊý£¬Ò²¿ ......
<title>JavaScriptÇл»Í¼Æ¬</title>
<script>
function showDaTu(src){
document.getElementById("defaultImg").src=src;
}
</script>
<img src="/jscss/demoimg/wall1.jpg" id="defaultImg">
<br><br><br>
<img src='/jscss/demoimg/wall_s1.jpg' onmouseover ......
¡¡¡¡¼¸ºõËùÓеĸ» Web Ó¦Óö¼»ùÓÚÒ»¸ö»ò¶à¸ö Web UI ¿â»ò¿ò¼Ü£¬ÕâЩ UI ¿âÓë¿ò¼Ü¼«´óµØ¼ò»¯ÁË¿ª·¢½ø³Ì£¬²¢´øÀ´Ò»Ö£¬¿É¿¿£¬ÒÔ¼°¸ß¶È½»»¥ÐÔµÄÓû§½çÃæ¡£±¾ÎĽéÉÜÁË15 ¸ö·Ç³£Ç¿´óµÄ JavaScript Web UI ¿â£¬·Ç³£Êʺϸ÷ÖÖ¸÷ÖÖ¹æÄ£µÄ¸» Web Ó¦ÓõĿª·¢¡£
¡¡¡¡LivePipe
¡¡¡¡LivePipe UI »ùÓÚ Prototype Javascript ¿ò¼Ü£¬°üº¬ÁË ......