µãµãµÎµÎ(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¡·Ò»ÎÄ£¬Ð´µÄʵÔÚÌ«ºÃÁË£¬¾ÍÊÕ¼ÁË£¬ÒÔ×ö¸ö±¸Óá£
Òý×Ó
& ......
¼¸ºõËùÓеĸ» Web Ó¦Óö¼»ùÓÚÒ»¸ö»ò¶à¸ö Web UI ¿â»ò¿ò¼Ü£¬ÕâЩ UI ¿âÓë¿ò¼Ü¼«´óµØ¼ò»¯ÁË¿ª·¢½ø³Ì£¬²¢´øÀ´Ò»Ö£¬¿É¿¿£¬ÒÔ¼°¸ß¶È½»»¥ÐÔµÄÓû§½çÃæ¡£±¾ÎĽéÉÜÁË 15 ¸ö·Ç³£Ç¿´óµÄ JavaScript Web UI ¿â£¬·Ç³£Êʺϸ÷ÖÖ¸÷ÖÖ¹æÄ£µÄ¸» Web Ó¦ÓõĿª·¢¡£
LivePipe
LivePipe UI »ùÓÚ Prototype Javascript ¿ò¼Ü£¬°üº¬ÁËÒ»ÕûÌ×¾Ñ ......
ȡֵ·½·¨£º
¶ÔÓ¦µÄ²¼¶ûÖµ: !!value
ÊÇ·ñ==1ºÍtrue: value == true
ÊÇ·ñ==0ºÍfalse: value == false
Êý¾ÝÀàÐͶÔÓ¦µÄ²¼¶ûÖµÊÇ·ñ==1ºÍtrueÊÇ·ñ==0ºÍfalse
×Ö·û´® 'abc'
true
false
false
×Ö·û´® '0'
true
false
true
¿Õ×Ö·û´®
false
false
true
´øÒ»¸ö¿Õ¸ñµÄ×Ö·û´®
true
false
true
Êý×Ö1
true
true
......
<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 ......