merhabalar, benim sorunum mobil bir tasarım ile alakalı. input'a telefondan tıkladığımda açılan klavyenin submit ile gonder butonuna bastığımda kapanmasını istemiyorum. Bunun bir çözümü var mı arkadaşlar.
Yardımlarınıza ihtiyacım var örnekleme ile.
submit sorunu
2
●117
- 03-10-2018, 20:02:57
$(document).ready(function() { $('#field').click(function(e){ $(this).focus(); }); $('#button').click(function(e) { $('#field').trigger('click'); }); });Bu tarz bir şey deneyebilirsiniz field yazı yazdığınız inputun idsi button da submit in idsi ile değiştirilmelidir.
Eğer işe yararsa R10+ butonuna basmayı unutmayın
- 03-10-2018, 20:20:24Dediğiniz şekilde denedim ancak tecrübesizliğim nedeniyle sonuca ulaşamamış olabilir fakat ben size bir kod yapısı vereyim. Acaba bura ile alakalı mı bi inceleyebilirseniz sevinirim.magicphp adlı üyeden alıntı: mesajı görüntüle
createInput: function() { var form = new Element("form"); this.input.appendChild(form); form.addClass("input"); var inputbox = new Element("input"); this.addEvent("signedOn", function() { inputbox.placeholder = "Lütfen mesaj veya komut gönderiniz..."; var d = function() { inputbox.addClass("input-flash"); }.delay(250); var d = function() { inputbox.removeClass("input-flash"); }.delay(500); var d = function() { inputbox.addClass("input-flash"); }.delay(750); var d = function() { inputbox.removeClass("input-flash"); }.delay(1000); var d = function() { inputbox.addClass("input-flash"); }.delay(1250); var d = function() { inputbox.removeClass("input-flash"); }.delay(1750); }); form.appendChild(inputbox); this.inputbox = inputbox; this.inputbox.maxLength = 470; var sendInput = function() { if(inputbox.value == "") return; this.resetTabComplete(); this.getActiveWindow().historyExec(inputbox.value, messagerenk); inputbox.value = ""; inputbox.placeholder = ""; }.bind(this); if(!qwebirc.util.deviceHasKeyboard()) { inputbox.addClass("mobile-input"); var inputButton = new Element("input", {type: "button"}); inputButton.addClass("mobile-button"); inputButton.addEvent("click", function() { sendInput(); inputbox.focus(); }); inputButton.value = "Gönder"; this.input.appendChild(inputButton); var reflowButton = function() { var containerSize = this.input.getSize(); var buttonSize = inputButton.getSize(); var buttonLeft = containerSize.x - buttonSize.x - 0; /* lovely 5 */ inputButton.setStyle("left", buttonLeft); inputbox.setStyle("width", buttonLeft - 0); inputButton.setStyle("height", containerSize.y); }.bind(this); this.qjsui.addEvent("reflow", reflowButton); } else { inputbox.addClass("keyboard-input"); } form.addEvent("submit", function(e) { new Event(e).stop(); sendInput(); }); var reset = this.resetTabComplete.bind(this); inputbox.addEvent("focus", reset); inputbox.addEvent("mousedown", reset); inputbox.addEvent("keypress", reset); inputbox.addEvent("keydown", function(e) { var resultfn; var cvalue = inputbox.value; if(e.alt || e.control || e.meta) return; if(e.key == "up" && !e.shift) { resultfn = this.commandhistory.upLine; } else if(e.key == "down" && !e.shift) { resultfn = this.commandhistory.downLine; } else if(e.key == "tab") { this.tabComplete(inputbox, e.shift); new Event(e).stop(); e.preventDefault(); return; } else { return; } this.resetTabComplete(); if((cvalue != "") && (this.lastcvalue != cvalue)) this.commandhistory.addLine(cvalue, true); var result = resultfn.bind(this.commandhistory)(); new Event(e).stop(); e.preventDefault(); if(!result) result = ""; this.lastcvalue = result; inputbox.value = result; qwebirc.util.setAtEnd(inputbox); }.bind(this)); },