0
I have a button and the same after the click I would like to remove the focus using javascript, detail do not use mouse using this button on a screen touch, no mouse or keyboard. I use the following function today to go up and down the screen:
$(document).ready(function(){
$('#up').click(function(){
$('html, body').animate({scrollTop : $(window).scroll().scrollTop()-500},800);
});
$('#down').click(function(){
$('html, body').animate({scrollTop : $(window).scroll().scrollTop()+500},800);
});
});
I need the clicked button to go out of focus.
Have you tested
$(this).blur()
inside the Event Handler?– Sergio
Yes tests the $(this). Blur() does not work for this case.
– Catana Rahmeier
@Catanarahmeier, you would like to take the focus for a style issue (the btn is with the edge), or is getting in the way of functionality ?
– Brunno
One possibility would be to set the focus to another field.
– Marcell Alves
I would like to change more for the sake of style. Setting the focus to another field is a possibility, I will try this on Monday, thank you...
– Catana Rahmeier