码迷,mamicode.com
首页 > 其他好文 > 详细

百度在线手写板代码

时间:2014-07-17 19:02:52      阅读:635      评论:0      收藏:0      [点我收藏+]

标签:style   http   color   art   io   for   

<!doctype html> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html;charset=gb2312"> 
<title>百度在线手写板代码-php自学网</title> 
<style> 
#sx{color:#00C;text-decoration:underline;cursor:pointer;} 
</style> 
</head> 
<body> 
<form name="f" action="s"> 
<input type="text" name="wd" id="kw" maxlength="100"> 
<input type="submit" value="" id="su"> 
<span id="sx">手写</span> 
</form> 
<script> 
var w = window,d = document,n = navigator,k = d.f.wd 
if (w.attachEvent) { 
w.attachEvent("onload", function() {k.focus();}) 
} else { 
w.addEventListener(‘load‘, function() {k.focus()},true) 
}; 
var hw = {}; 
hw.i = d.getElementById("sx"); 
var il = false; 
if (/msie (\d+\.\d)/i.test(n.userAgent)) { 
hw.i.setAttribute("unselectable", "on") 
} else { 
var sL = k.value.length; 
k.selectionStart = sL; 
k.selectionEnd = sL 

hw.i.onclick = function(B) { 
var B = B || w.event; 
B.stopPropagation ? B.stopPropagation() : (B.cancelBubble = true); 
if (d.selection && d.activeElement.id && d.activeElement.id == "kw") { 
hw.hasF = 1 
} else { 
if (!d.selection) { 
hw.hasF = 1 


if (!il) { 
var A = d.createElement("script"); 
A.setAttribute("src", "http://www.baidu.com/hw/hwInput.js"); 
d.getElementsByTagName("head")[0].appendChild(A); 
il = true; 

}; 
</script> 
</body> 
</html> 

百度在线手写板代码,布布扣,bubuko.com

百度在线手写板代码

标签:style   http   color   art   io   for   

原文地址:http://blog.csdn.net/ws07_byyy/article/details/37912895

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!