上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 24 下一页
摘要: 1 //getClipboardText2 EventUtil.addHandler(textbox, "paste", function(event) {3 event = EventUtil.getEvent(event);4 var text = EventUtil.getClipboardText(event);5 6 if (!/^\d*$/.test(text)) {7 EventUtil.preventDefault(event);8 }9 }); 阅读全文
posted @ 2012-06-04 11:42 小猩猩君 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 1 var textbox = document.forms[0].elements["textbox1"]; 2 3 //文本框忽略所有输入的非数值 4 EventUtil.addHandler(textbox, "keypress", function(event) { 5 event = EventUtil.getEvent(event); 6 var target = EventUtil.getTarget(event); 7 var charCode = EventUtil.getCharCode(event); 8 9 if (!/\d/.t 阅读全文
posted @ 2012-06-03 23:10 小猩猩君 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html;ch 阅读全文
posted @ 2012-06-03 17:01 小猩猩君 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html;ch 阅读全文
posted @ 2012-06-03 15:44 小猩猩君 阅读(3992) 评论(0) 推荐(0) 编辑
摘要: 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html;ch 阅读全文
posted @ 2012-06-03 12:45 小猩猩君 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html;ch 阅读全文
posted @ 2012-06-01 15:07 小猩猩君 阅读(1309) 评论(0) 推荐(0) 编辑
摘要: DOM 1 var btn = document.getElementById("myBtn"); 2 3 //创建事件对象 4 var event = document.createEvent("MouseEvents"); 5 6 //初始化事件对象 7 event.initMouseEvent("click", true, true, document.defaultView, 0, 0, 0, 0, 0, false, false, false, false, 0, null); 8 9 //触发事件10 btn.dispat 阅读全文
posted @ 2012-06-01 10:53 小猩猩君 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html;ch 阅读全文
posted @ 2012-05-31 21:13 小猩猩君 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 1 (function() { 2 function handleMouseWheel(event) { 3 event = EventUtil.getEvent(event); 4 var delta = EventUtil.getWheelDelta(event); 5 console.log(delta); 6 } 7 8 EventUtil.addHandler(document, "mousewheel", handleMouseWheel); 9 EventUtil.addHandler(docum... 阅读全文
posted @ 2012-05-31 16:57 小猩猩君 阅读(1124) 评论(0) 推荐(0) 编辑
摘要: 1 var a = [];2 alert(a.constructor == Array); 阅读全文
posted @ 2012-05-31 16:31 小猩猩君 阅读(151) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 24 下一页