How to do the S searchbox like here?

February 26th, 2022

I know keyboard events, e.which and charcode for S is 83 but still having troubles getting the right code…
I know how to do the dialog ofc but I need to first get a working code that makes something happen when the users hits S and only like here, eg not when I’m typing here and type s.

Answer #1
What is your code?
You can also view the source code of the S listener.
Answer #2

    $("body").on("keyup",function(e){
      console.log(e.which);
            if ( e.which === 83) {
               $("#contactus").dialog( "open" );
            }
});

The problem is this works but makes the dialog open even if I’m typing here and the letter s is typed.
Here it only works if I’m not active in an input.
I need an other check in my code.
Also I don’t see any source code listener in view sources tab.
Answer #3
You can make the listener work only outside typing boxes.
Answer #4
What listener are you talking about and that is exactly what I want to do… So can you help me with a working code? Your above message does not solve my issue.

 

| Sitemap |