Js + flash implement special effects of handwriting Input
This js special effect is a very practical and commonly used function. More and more websites are now joining the handwriting function, mainly for the convenience of text input by netizens who are not too easy to type or are too lazy to type, to facilitate the use of Internet users, the entire search function and handwriting are sorted out and used directly with background programs.
It mainly includes the following js function special effects:
1. Search for special effects
2. Pop-up special layer effects
3. Special handwriting Effects
4. move the cursor to the text box to select all results
The main handwriting Function Code is as follows:
function open_lw(c) { var g = "showflash"; var a = document.getElementById("showButton"); var b = getCoords(a); if (!document.getElementById(g)) { var f = document.createElement("div"); var e = b.y + 26; var d = b.x; f.style.left = d + "px"; f.style.top = e + "px"; f.style.margin = "0px"; f.style.padding = "0px"; f.style.position = "absolute"; f.style.zIndex = "9999"; f.id = g; f.innerHTML = c; f.style.background = "#fff"; document.body.appendChild(f) } else { iciba_shouxie_close() }}function getCoords(c) { var a = c.offsetLeft - 30; var d = c.offsetTop; var b = c.offsetParent; while (b != null) { a += b.offsetLeft; d += b.offsetTop; b = b.offsetParent } return { x: a, y: d }}function iciba_shouxie_close() { var a = "showflash"; if (document.getElementById(a)) { document.body.removeChild(document.getElementById(a)) }}
The running effect is as follows:
Online Demo
This js special effect is a very practical and commonly used function. More and more websites are now joining the handwriting function, mainly for the convenience of text input by netizens who are not too easy to type or are too lazy to type, to facilitate the use of Internet users, the entire search function and handwriting are sorted out and used directly with background programs.
It mainly includes the following js function special effects:
1. Search for special effects
2. Pop-up special layer effects
3. Special handwriting Effects
4. move the cursor to the text box to select all results
The main handwriting Function Code is as follows:
function open_lw(c) { var g = "showflash"; var a = document.getElementById("showButton"); var b = getCoords(a); if (!document.getElementById(g)) { var f = document.createElement("div"); var e = b.y + 26; var d = b.x; f.style.left = d + "px"; f.style.top = e + "px"; f.style.margin = "0px"; f.style.padding = "0px"; f.style.position = "absolute"; f.style.zIndex = "9999"; f.id = g; f.innerHTML = c; f.style.background = "#fff"; document.body.appendChild(f) } else { iciba_shouxie_close() }}function getCoords(c) { var a = c.offsetLeft - 30; var d = c.offsetTop; var b = c.offsetParent; while (b != null) { a += b.offsetLeft; d += b.offsetTop; b = b.offsetParent } return { x: a, y: d }}function iciba_shouxie_close() { var a = "showflash"; if (document.getElementById(a)) { document.body.removeChild(document.getElementById(a)) }}
The running effect is as follows:
Online Demo