RWDは私達に積極的な要素に連絡してください
-
29-09-2020 - |
質問
RWDテーマの連絡先ページには、カーソルがこのボックスに入っているように、ページ上に着地したときに「名前」ボックスがあり、強調表示されます。あなたがこのページにアクセスするたびにあなたの顔にキーボードでヒットされているので、これはモバイルデバイスの迷惑です。アクティブである「名前」ボックスを無効にするにはどうすればよいですか?
解決
コードの変更:
<script type="text/javascript">
//<![CDATA[
var contactForm = new VarienForm('contactForm', true);
//]]>
</script>
.
to:
<script type="text/javascript">
//<![CDATA[
var contactForm = new VarienForm('contactForm', false);
//]]>
</script>
.
このファイルをチェックする 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){}
}
}
.
FirstFieldFocusをfalseに設定した場合、最初のフィールドにフォーカスが発生しません。
所属していません magento.stackexchange