0

this is just a stylistic thing but maybe someone has something that has worked for them that shows ingenuity.

So, after you click a div which has an onclick event, the cursor is left blinking at the spot you clicked. It certainly doesn't harm anything, but what's a good way to move the cursor out of the way somewhere? I had thought of "focusing" on a hidden input but that seems very hacked.

<div onclick="doSomething()">Click Here</div>

(if I click this then the cursor will be somewhere within the words Click Here)

And this only shows (at least in FireFox) when you have "Always use the cursor keys to navigate within pages" checked under Preferences > Advanced. So you may not notice this unless you turn this on.

Samuel Fullman
  • 1,262
  • 1
  • 15
  • 20
  • 1
    _"So, after you click a div which has an onclick event, the cursor is left blinking at the spot you clicked"_ - It is? I don't recall having seen that. – nnnnnn Sep 10 '14 at 14:08
  • I've never seen that happen by accident. Do you have an example page that illustrates the issue? Maybe there's more at play than you recognize. – PaulProgrammer Sep 10 '14 at 14:08
  • @PaulProgrammer I edited my post. See the example – Samuel Fullman Sep 10 '14 at 14:26
  • 1
    As your sayy, I can reproduce that behaviour only with FF and enabling "Always use the cursor keys to navigate within pages". If I disable this option, then nothing special happens. Neither in Chrome or IE. JSFiddle: http://jsfiddle.net/tzse84f8/ – Tobías Sep 10 '14 at 14:39
  • I don't think that's default behavior, and seems tied to an option you've enabled in FF. Do you think it's worthwhile to "fix" an "issue" that will only affect a very small portion of users who modify default behaviors? – PaulProgrammer Sep 10 '14 at 14:45
  • Well if it bothers me it must be an issue :) No, I just thought someone had dealt with this. I'm a "power user" and the cursor is helpful sometimes. I sometimes see the cursor blinking over facebook videos when I watch them for example. It's not a huge deal. – Samuel Fullman Sep 10 '14 at 16:53
  • Possibly this might work? http://stackoverflow.com/questions/826782/css-rule-to-disable-text-selection-highlighting – Evan Knowles Sep 11 '14 at 08:56

0 Answers0