blinking cursor
This commit is contained in:
parent
a23ef8e775
commit
b79abd8de8
1 changed files with 11 additions and 0 deletions
|
|
@ -24,12 +24,23 @@ CursorLayer.prototype.hideCursor = function()
|
||||||
if (this.cursor.parentNode) {
|
if (this.cursor.parentNode) {
|
||||||
this.cursor.parentNode.removeChild(this.cursor);
|
this.cursor.parentNode.removeChild(this.cursor);
|
||||||
}
|
}
|
||||||
|
clearInterval(this.blinkId);
|
||||||
};
|
};
|
||||||
|
|
||||||
CursorLayer.prototype.showCursor = function()
|
CursorLayer.prototype.showCursor = function()
|
||||||
{
|
{
|
||||||
this.isVisible = true;
|
this.isVisible = true;
|
||||||
this.element.appendChild(this.cursor);
|
this.element.appendChild(this.cursor);
|
||||||
|
|
||||||
|
var cursor = this.cursor;
|
||||||
|
cursor.style.visibility = "visible";
|
||||||
|
|
||||||
|
this.blinkId = setInterval(function() {
|
||||||
|
cursor.style.visibility = "hidden";
|
||||||
|
setTimeout(function() {
|
||||||
|
cursor.style.visibility = "visible";
|
||||||
|
}, 400);
|
||||||
|
}, 1000);
|
||||||
};
|
};
|
||||||
|
|
||||||
CursorLayer.prototype.getPixelPosition = function() {
|
CursorLayer.prototype.getPixelPosition = function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue