点击这里给我发消息 点击这里给我发消息

仿百度手写搜索特效

添加时间:2011-9-2
    相关阅读: 建站 百度
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<title>建站学特效代码--手写板</title>
<style>
#sx{color:#00C;text-decoration:underline;cursor:pointer;}
</style>
</head>
<body>
单击“手写”可以在手写区输入,然后点击备选区的相应文字,完成输入!
<br>
<form name="f" action="http://www.jzxue.com">
<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>
本文作者:未知
咨询热线:020-85648757 85648755 85648616 0755-27912581 客服:020-85648756 0755-27912581 业务传真:020-32579052
广州市网景网络科技有限公司 Copyright◎2003-2008 Veelink.com. All Rights Reserved.
广州商务地址:广东省广州市黄埔大道中203号(海景园区)海景花园C栋501室
= 深圳商务地址:深圳市宝源路华丰宝源大厦606
研发中心:广东广州市天河软件园海景园区 粤ICP备05103322号 工商注册