RWD Contáctenos elemento activo
-
29-09-2020 - |
Pregunta
La página Contáctenos en el tema RWD tiene el cuadro "Nombre" como el elemento activo cuando aterriza en la página para que el cursor esté en este cuadro y se resalte.Esta es una molestia en un dispositivo móvil porque se le pega con un teclado en la cara cuando vaya a esta página.¿Cómo puedo deshabilitar el cuadro "Nombre" activo?
Solución
Cambiar por debajo del código:
<script type="text/javascript">
//<![CDATA[
var contactForm = new VarienForm('contactForm', true);
//]]>
</script>
a:
<script type="text/javascript">
//<![CDATA[
var contactForm = new VarienForm('contactForm', false);
//]]>
</script>
Verifique este archivo js / varien / form.js
initialize: function(formId, firstFieldFocus){
this.form = $(formId);
if (!this.form) {
return;
}
this.cache = $A();
this.currLoader = false;
this.currDataIndex = false;
this.validator = new Validation(this.form);
this.elementFocus = this.elementOnFocus.bindAsEventListener(this);
this.elementBlur = this.elementOnBlur.bindAsEventListener(this);
this.childLoader = this.onChangeChildLoad.bindAsEventListener(this);
this.highlightClass = 'highlight';
this.extraChildParams = '';
this.firstFieldFocus= firstFieldFocus || false;
this.bindElements();
if(this.firstFieldFocus){
try{
Form.Element.focus(Form.findFirstElement(this.form))
}
catch(e){}
}
}
Si establece FirstFieldFocus a FALSO, no activará el enfoque en el primer campo.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange