Problema (conforme imagem) quando clica em uma tag <select>
O problema não ocorre no Google Chrome e no Microsoft Edge
Esta linhas:
var x = document.activeElement.… (saiba mais)
Problema (conforme imagem) quando clica em uma tag <select>
O problema não ocorre no Google Chrome e no Microsoft Edge
Esta linhas:
var x = document.activeElement.id
var i = x.substring(3,5)
var xx = event.clientX / 18
var xy = event.clientY / (10 + i)
se for alterada para :
var xx;
var xy;
o problema não ocorre mais
segue o html:
<script language="JavaScript">
document.addEventListener("mouseup", function(event) {
document.getElementById("jus").style.display = "inline-block";
var x = document.activeElement.id
var i = x.substring(3,5)
var xx = event.clientX / 18
var xy = event.clientY / (10 + i)
if (i == "01") {
xx = "3.7%";
}
if (i == "02") {
xx = "5.9%";
}
if (i == "03") {
xx = "8.1%";
}
if (x.substring(7,9) == "16") {
xy = "41.2%";
}
if (x.substring(7,9) == "17") {
xy = "43.9%";
}
if (x.substring(7,9) == "18") {
xy = "46.7%";
}
document.getElementById("jus").style.left = xy ;
document.getElementById("jus").style.top = xx ;
});
</script>
<input value="1:20" id="wg101c116">
<input value="2:20" id="wg102c117">
<input value="3:20" id="wg103c118">
O problema esta nestas 2 linhas
var xx = event.clientX / 18
var xy = event.clientY / (10 + i)
se for alterado para
var xx;
var xy;
o problema nao ocorre
Não ocorre o erro no Google Chrome e no Microsoft Edge
<select id="cars" style="font-size: 11px; color: #0000a0; text-Shadow: 5px 5px 10px rgba(0, 0, 0, 0.3); margin-left:10px; ">
<option value="aaaa1">aaaa1</option>
<option value="aaaa2">aaaa2</option>
<option value="aaaa3">aaaa3</option>
<option value="aaaa4">aaaa4</option>
</select>