Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comi've used the other solution.../*
function setfocus(){
if(arguments.length<1)return;
if(arguments[0]==='true')inputelement.focus();
else inputelement.blur();
}
![]()
Quellcode
1 2 3 4 5 6inputelement.addEventListener('touchstart',text_click, false); function text_click() { inputelement.focus(); }

|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
/*
krpano - super simple html5 text input plugin
*/
var krpanoplugin = function()
{
var local = this;
var krpano = null;
var plugin = null;
var inputelement = null;
local.registerplugin = function(krpanointerface, pluginpath, pluginobject)
{
krpano = krpanointerface;
plugin = pluginobject;
inputelement = document.createElement("input");
inputelement.type = "text";
inputelement.style.width = "100%";
inputelement.style.height = "100%";
plugin.registerattribute("text", "", text_set, text_get);
plugin.registerattribute("onchanged", null);
inputelement.addEventListener("change", text_changed, true);
inputelement.addEventListener("touchstart",text_click, true);
inputelement.addEventListener("blur", e => {e.target.focus();});
plugin.sprite.appendChild(inputelement);
}
local.unloadplugin = function()
{
plugin = null;
krpano = null;
}
function text_click()
{
inputelement.focus();
}
function text_set(newtext)
{
inputelement.value = newtext;
}
function text_get()
{
return inputelement.value;
}
function text_changed()
{
krpano.call(plugin.onchanged, plugin);
}
};
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Nupsi« (28. September 2021, 10:39)