Another script, cross word play icon bar
Move the mouse from icon bar to text box, or click the icon to perform functions, such as copying, icon bar disappear automatically after the mouse in the text box, automatically revisit the text box, cross word words will disappear, the cursor at the end of the text
How to make the mouse from the icon bar, move back to the text box is no longer automatic focusing, zoned reserved word words
The monkey has a way of thinking, the use of oil storage element of the location of the mouse, move to the next is one of the elements is the img element judgment, not automatic focusing, from input, textarea element to the img element to remove out-of-focus timing
Don't know how to store the elements, as the next judgment
Icon bar element e. arget. LocalName==='img'
Cross word play icon bar tool
//automatic focusing
Document. The addEventListener (' mouseover, function (e) {
If (e. arget. LocalName==='input' | | e. arget. LocalName==='textarea') {
E. arget. Focus ();
Var val=e. arget. Value;//store the value of the element
e.target.valuehttps://bbs.csdn.net/topics/=';//clear the value of the element
E. arget. Value=https://bbs.csdn.net/topics/val;//set that value back.
}
});
//out-of-focus
Document. The addEventListener (' mouseout ', function (e) {
Var text=window. GetSelection (). The toString (). The trim ();
The timer=setTimeout (function () {
E. arget. The blur ();
}, 20)
If (text) {
ClearTimeout (timer);
}
},false);
