What's the trick Twitter uses with regard to css?
When I click buttons on the timeline my browser (chrome) does not focus the button. The main focus was on the element where it was. How do they do it?
This is what I found.
- They don't use the function
blur()
when pressed. If they call the method, the pre-existing focus will disappear. - They don't seem to keep the previous focused element and will reorient it. When I overridden the method
$.fn.focus
, it was not called. - They use some JavaScript trick. When I turned off JavaScript, I was able to focus the element by clicking the buttons.
+3
source to share
1 answer
What you want to do is focus on the element whenever someone clicks on a specific element.
Click here to see an example of how I would do it
This is what you are looking for
6 | searchButton.focus();
UPDATE:
Your question is incomprehensible and you are in doubt as to how it keeps the focus on the same element ... and I showed you how ..
0
user2422913
source
to share