페이지 상단에 검색 창이 있습니다. 아약스 사용 페이지 위로 div를 두어 검색 결과를 표시하고 싶습니다. 핵심은 검색 결과가 페이지를 아래로 밀어 내리는 것이 아니라 아래로 밀어 내리는 것입니다. 이런 이유로, 나는 searchbox 밑에 div를 가질 수 없다. 좀 더 복잡한 작업이 필요합니다. 그러나 무엇이 확실하지 않습니다.javascript/php div 드롭 다운 검색 결과
다음 코드는 검색 상자 아래에 div를 채 웁니다. 누구든지 div를 페이지를 넘기보다는 모든 것을 푸시 다운하는 경제적 방법을 제안 할 수 있습니까? 어떤 제안을 주셔서 감사합니다!
자바 스크립트
function showResults(str) {
document.getElementById("results").innerHTML=xmlhttp.responseText;
document.getElementById("results").style.border="1px solid #A5ACB2";
//some ajax
xmlhttp.open("GET","search.php?str="+str,true);
xmlhttp.send();
}
HTML 당신은 절대적으로 당신의 결과 DIV를 배치해야
<html>
<body>
<table><tr><td><img src="logo.gif"></td><td>
<input type="text" id="string" onkeyup="showResults(this.value)">
<div id="results"></div><td></tr>
<tr><td colspan=2
Main body of page. All sorts of text and html go here that I do not want pushed down.
</td></tr></table>
</body>
</html>
절대적으로 배치하십시오. – j08691
div를 절대적으로 위치 시키시겠습니까? – user1260310