문제

How is the blinking caret emulated in Etherpad? (See a live version at ietherpad.com) The way I would do it, is to create a div and position it absolutely where the caret should be. Then, display and remove it in regular intervals. However they seem to do it differently.

The text of a row is in

<div id="magicdomid2" class="">...</div>

I can't see anything changing around the div. How is it done?

도움이 되었습니까?

해결책

It isn't emulated. In modern browsers, Etherpad creates an iframe containing a document with the tag:

<body contenteditable="true">

Which tells the browser to allow editing of the contained HTML document. The carat is one of the effects of including that attribute.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top