11/26 - Scarves Saturday!

Have you nominated a November Crowd Pleaser yet?


  • Total voters
    29
  • Poll closed .
Status
Not open for further replies.

Pleco

Friendly Neighborhood Rat
Contributor
Crowd Pleaser
Joined
Jan 23, 2016
Messages
19,190
Reaction score
76,218
Points
1,588
Age
37
Gender
Male
yeahhh I dont want to be asked if i've heard of a kawasaki before or that there is a sushi place nearby or something
"You're such a well-spoken young man, forming complete sentences and everything".
 

Hinatadragon

Member
Joined
Jun 13, 2016
Messages
278
Reaction score
247
Points
293
Gender
Female

lil queen trashmouth

Pile of ham
Contributor
Joined
Jul 6, 2016
Messages
5,115
Reaction score
17,359
Points
1,013
Age
35
Location
Iowa
Gender
Female
"You're such a well-spoken young man, forming complete sentences and everything".
Hey, wanted you to know I had a salad today to keep turkfit alive solely to spite you, ya Rump Bonnet
 
  • Like
Reactions: Pleco

Jharkan

Internets EXPERT
Contributor
Joined
Jul 9, 2016
Messages
11,873
Reaction score
20,418
Points
1,288
Location
Earth
Gender
Male
Here, I will try to make this as easy to understand as possible.
Code:
// This is your "counter" variable
let idx = 0;

// This adds a listener when you press a key.
document.addEventListener('keydown', (e) => {
  switch (e.which) {
      // If the 1 (case 49) key or Numpad1 (case 97) key are pressed.
    case 49: case 97:

      // Everything is zero indexed, so the first radio is 0, the second is 1 and so on.
      // $(':even') will get all of the radios that are 0,2,4,6.... So being zero indexed means..
      // it will choose the 1st, 3rd, 5th, 7th....
      // .eq(idx ++) will choose which of the :even radios, so $(':radio:even').eq(2) will choose the 5th radio.
      // .click() will click on the element.
      // So we are getting all of the even radios, then choosing which we want out of those and clicking it, then adding +1 to the index.
      $(':radio:even').eq(idx ++).click();

      // This will focus the next radio, scrolling the page if necessary
      $(':radio:even').eq(idx).focus();
      break;
      // If the 2 (case 50) key or Numpad2 (case 98) key are pressed.
    case 49: case 97:
      // Same as above, but odds instead of evens.
      $(':radio:odd').eq(idx ++).click();

      // This will focus the next radio, scrolling the page if necessary
      $(':radio:even').eq(idx).focus();
      break;
    default: return;
  }
});
so in this case, if I wanted to choose a potential third button, I would push 1 twice?
but that would be irrelevant, becuase I would only use an even/odd if there were two options?
 

lil queen trashmouth

Pile of ham
Contributor
Joined
Jul 6, 2016
Messages
5,115
Reaction score
17,359
Points
1,013
Age
35
Location
Iowa
Gender
Female
Blah today was even worse than yesterday. Time for :vanyanka::weed: and basketball, see you all in the morning

Today's Projected Earnings: $7.98
Log in or register now. to view Spoiler content!
 
  • Like
Reactions: PhantomCatt

Pleco

Friendly Neighborhood Rat
Contributor
Crowd Pleaser
Joined
Jan 23, 2016
Messages
19,190
Reaction score
76,218
Points
1,588
Age
37
Gender
Male
Hey, wanted you to know I had a salad today to keep turkfit alive solely to spite you, ya Rump Bonnet
I'm sorry you had such an awful day. I know we're not married anymore and things didn't end well, but nobody deserves salad and I truly hope things get better for you.

:hug:
 

Kadauchi

Well-Known Member
Master Pleaser
Crowd Pleaser
Joined
Jan 12, 2016
Messages
7,098
Reaction score
21,951
Points
1,263
This is incredibly helpful. If you could do this with all of your scripts, I could actually learn stuff. And would be really annoying for you and is also way too much to ask, but hey I can dream, right? :D
Ha, keep dreaming. If you want help or have questions feel free to ask me though.
so in this case, if I wanted to choose a potential third button, I would push 1 twice?
but that would be irrelevant, becuase I would only use an even/odd if there were two options?
Correct, :even :odd in this case is only relevant for a 2 radio option. If you had 3 options so choose from, one way to do it would be like this.

Code:
// This is your "counter" variable
let idx = 0;

// This adds a listener when you press a key.
document.addEventListener('keydown', (e) => {
  switch (e.which) {
    case 49: case 97:
      $(':radio').eq(0 + idx).click();
      idx += 3;
      $(':radio').eq(idx).focus();
      break;
    case 50: case 98:
      $(':radio').eq(1 + idx).click();
      idx += 3;
      $(':radio').eq(idx).focus();
      break;
    case 51: case 99:
      $(':radio').eq(2 + idx).click();
      idx += 3;
      $(':radio').eq(idx).focus();
      break;
    default: return;
  }
});
 
  • Like
Reactions: T. Leela

Jharkan

Internets EXPERT
Contributor
Joined
Jul 9, 2016
Messages
11,873
Reaction score
20,418
Points
1,288
Location
Earth
Gender
Male
ugghhh... I'm $0.99 under my daily goal, but $56.39 over my weekly goal...
and yet, I feel compelled to make or break my daily
 
  • Like
Reactions: PhantomCatt

GTR

Well-Known Member
Joined
Feb 10, 2016
Messages
10,278
Reaction score
22,985
Points
1,313
Gender
Male
"Baby cribs now with more penis" -Big Requester
 

GTR

Well-Known Member
Joined
Feb 10, 2016
Messages
10,278
Reaction score
22,985
Points
1,313
Gender
Male
OH and Big Requester did not disappoint the guys with the unexpected muff shot.
 

GTR

Well-Known Member
Joined
Feb 10, 2016
Messages
10,278
Reaction score
22,985
Points
1,313
Gender
Male
The REAL question here is... how in the F does Big Requester acquire these pics? I think this is why you don't want video cameras running anywhere in your home.
 
  • Like
Reactions: PhantomCatt
Status
Not open for further replies.