Jump to content

freak12345

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

freak12345's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. please help me modify this script to make div scroll when using keyboard arrow up and down to selected the items. var searchReq = open_xmlhttp(); function searchSuggest(CityName,StateName){ if(searchReq.readyState == 4 || searchReq.readyState == 0) { var query = escape(document.getElementById('query_search').value); var query_city = escape(CityName); var query_state = escape(StateName); nocache = Math.random(); searchReq.open('GET', 'index.php?<?php echo $visitorsid ?>=ajax_suggest_search&query='+query+'&city2='+query_city+'&state2='+query_state+'&nocache='+nocache); searchReq.onreadystatechange = handleSearchSuggest; searchReq.send(null); } } function handleSearchSuggest(){ if(searchReq.readyState==4) { var ssa = document.getElementById('sboxsuggest'); ssa.innerHTML = ''; var query = searchReq.responseText.split('\n'); if(query == '') { document.getElementById('sboxassist').style.display = "none"; document.getElementById('sboxsuggest').style.display = "none"; document.getElementById('sboxscrollmain').style.display = "none"; document.getElementById('popupsmall_location').style.display = "none"; document.getElementById('popupsmall_login').style.display = "none"; } else { document.getElementById('sboxscrollmain').style.display = "inline"; document.getElementById('sboxassist').style.display = "inline"; document.getElementById('sboxsuggest').style.display = "inline"; document.getElementById('popupsmall_location').style.display = "none"; document.getElementById('popupsmall_login').style.display = "none"; } for(i=0; i < query.length-1; i++) { I want to modify this part to be able to scroll and up down using arrow up and down to select the items. var suggesta = '<div style="border: 3px solid gray" onmouseover="suggestOver(this);"'; suggesta += 'onmouseout="suggestOut(this);"'; suggesta += 'onclick="setSearch(this.innerHTML);"'; suggesta += 'class="sboxsuggest">'+query+'</div>'; ssa.innerHTML += suggesta; } } } function suggestOver(div_value){ div_value.className = 'sboxsuggestlinkover'; } function suggestOut(div_value){ div_value.className = 'sboxsuggestlink'; } function setSearch(value){ document.getElementById('query_search').value = value; document.getElementById('sboxassist').style.display = "none"; document.getElementById('sboxsuggest').style.display = "none"; document.getElementById('sboxscrollmain').style.display = "none"; document.getElementById('popupsmall_location').style.display = "none"; document.getElementById('popupsmall_login').style.display = "none"; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.