1

Anyone with firefox browser can you open up this fiddle.

The issue I have is with this checkbox button I have, it requires multiple clicks to turn it off and my question is how can I stop this from happening? I know its the posistion:relative which is causing this but I need this so that every time I click on a button, it does not go to the top of the page. I just want the button to turn on and off in one click, not multiple clicks

xlecoustillier
  • 16,183
  • 14
  • 60
  • 85
user2048994
  • 270
  • 4
  • 14
  • I need just one click. Latest FF. – Mörre Feb 08 '13 at 16:44
  • @Mörre wish I had your FF haha. You see on mine what it does is lets say button is off, when I click on it,, it turns green which is fine, but then when I click on it again, it highlights the letter and button remains green, then when I click it again, then the button is off by changing back to original color – user2048994 Feb 08 '13 at 16:49
  • @user2048994 what version of FF do you have anyway? And do you need to support it? – Explosion Pills Feb 08 '13 at 16:51

1 Answers1

1

(See comments below the question - now I know what happens to you)

Ahhh - you cannot solve this without Javascript: quick (double?) click on the TEXT ITSELF is interpreted as "select text" by the browser, and it does not send the event to the checkbox when that happens. With Javascript you can force "un-select" of the text on click.

Click "slowly" - avoiding double click text selection - and it will work (just to show the cause of the problem, no solution without Javascript or proprietary CSS).

Try adding this: Prevent text selection after double click

Maybe you should use a full Javascript Checkbox-Button solution instead of trying to accomplish it with just CSS.

Community
  • 1
  • 1
Mörre
  • 5,699
  • 6
  • 38
  • 63