Placing a caret on the screen

D

Davo

Hello all,

I'm trying to figure out how to place a blinking caret on a web page
(without a text box etc.). How do writeley and so on do it?

The only way I can figure out is to find the dom position and insert a
blinking image at the position in the dom, is this the way to do it or is
there an easier way?

tia,
Davo
 
V

VK

Davo said:
Hello all,

I'm trying to figure out how to place a blinking caret on a web page
(without a text box etc.). How do writeley and so on do it?

The only way I can figure out is to find the dom position and insert a
blinking image at the position in the dom, is this the way to do it or is
there an easier way?

It depends on what are you actually doing. Is it a input="text"
emulation using <span> or <div>?
 
P

plato

You can put the caret inside a <span> tag and use JavaScript's
manipulation of CSS to alternately hide and display the <span> after a
delay. For instance, display, wait 1 second, hide, wait 1 second.
Lather, rinse repeat.
 
D

Davo

Not really sure yet, I'm seeking opinions as to the best way to do it. What
difference does having a span or div have?

thanks,
Davo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top