Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom dia Pessoal;
se esse topico estiver no forum errado me desculpe, mas vamos ao problema.
Eu tenho um script javascript que cria uma div dentro do meu html. Esse script esta dentro da minha div #conteudo e dentro da uma fieldset.
Porem essa div não ficando dentro da minha div #conteudo -> fieldset. Segue o meu script javascript
<script>
var arvore = new Array(<%=razao_social%>"");
//document.write('<style type="text/css">'+
//'#listHolder{border:1px solid #f00;height:auto;width:300px;}'+
//'.list{font-family:Calibri;font-size:12;color:#000;background:#fff;height:auto;border:none;margin:auto;width:300px;}'+
//'<\/style>')
function checkList(obj,nStr, e) {
var k = (window.Event) ? e.which : e.keyCode;
var T = findPosY(obj); //top
var L = findPosX(obj); //left
var list = document.getElementById('listHolder');
if(!list) {
var list = document.createElement('DIV');
list.id = 'listHolder';
document.body.appendChild(list);
}
list.style.top=(T+obj.offsetHeight);
list.style.left=L;
list.style.display='none';
var txt=obj.value;
if (txt) {
var str='<select class="list"'+
'onclick="setOption(\''+obj.id+'\',this.options[this.selectedIndex].value)"'+
'onkeyup="if(event.keyCode==13){setOption(\''+obj.id+'\','+
'this.options[this.selectedIndex].value)};if(event.keyCode==27){'+
'document.getElementById(\'listHolder\').style.display=\'none\';'+
'document.getElementById(\''+obj.id+'\').focus()};" id="selector" size="6">'
var match=false
for(a=0;a<nStr.length;a++){
if(txt.toLowerCase()==nStr[a].toLowerCase().substring(0,txt.length)){
match=true
str+=('<option value="'+nStr[a].replace(/\'/gi,'’')+'">'+nStr[a]+'</option>')
}
}
str+='</select>'
if(match){var sel=document.getElementById('selector')
if(k=='40') {if(k=='13'){
document.getElementById('listHolder').style.display='none'
}
}
}
}
function setOption(obj,val){
var obj=document.getElementById(obj)
obj.value=val;
obj.focus()
document.getElementById('listHolder').style.display='none'
}
function findPosX(obj){
var curleft=0;
if(obj.offsetParent) {
while(obj.offsetParent){
curleft+=obj.offsetLeft
obj=obj.offsetParent;
}
} else if(obj.x)
curleft+=obj.x;
return curleft;
}
function findPosY(obj){
var curtop=0;
if(obj.offsetParent){obj=obj.offsetParent;
}
} else if(obj.y)
curtop+=obj.y;
return curtop;
}
</SCRIPT>
Agora segue o meu código CSS.
<style type="text/css">
#listHolder{
border:1px solid #f00;
height:auto;
width:300px;
margin:auto;
}
.list{
font-family:Calibri;
font-size:12;
color:#000;
background:#fff;
height:auto;
border:none;
margin:auto;
width:300px;
}
</style>
Segue a imagem de como esta ficando/applications/core/interface/imageproxy/imageproxy.php?img=http://tecnogalli.com.br/cplogistica/autocomplete1.png&key=ae231b14f776d1b722a1c4536055a0dd9d4e1dab0f762708de5a661562d55e07" alt="autocomplete1.png" />
Alguém sabe por de não esta ficando dentro da div #conteudo e da fieldset?
Att;
Carregando comentários...