移動端文本框會被擋住處理

var h = $(window).height(), mcss = $(".banner2-con").css("margin"); window.onresize=function(){ if( $(document.activeElement).hasClass("banner2-year")) { if($(window).height()<h){ $(".banner2-con").css("margin","0 auto 3.2rem"); }else{ $(".banner2-con").css("margin",mcss); } }else if($(window).height() == h){ $(".banner2-con").css("margin",mcss); } }; //year輸入框回車事件,fix andorid keyboard next button bug
$('#txtyear').keydown(function(e) { //tab or enter event
if (e.keyCode == 9 || e.keyCode == 13) { e.preventDefault(); $('#btnConfirm').click(); $(this).blur(); } });
相關文章
相關標籤/搜索