WorldDrknss Posted September 24, 2007 Share Posted September 24, 2007 I am trying to close an auto suggestion box if a user would click anywhere on the window that is outside of the autosuggestdiv. This is the code I am using: function mouseclickbtn(e){ var mouseclickbtn = e.which; if(mouseclickbtn == undefined){ mouseclickbtn = e.button; } if(mouseclickbtn < 2){ acObject = document.getElementById("autosuggestdiv"); acObject.style.visibility = "hidden"; acObject.style.height = "0px"; acObject.style.width = "0px"; } } But it does not work. Any suggestions. TIA Quote Link to comment Share on other sites More sharing options...
WorldDrknss Posted September 24, 2007 Author Share Posted September 24, 2007 I solved it by using function mouseclickbtn(){ if(window.addEventListener){ window.addEventListener('click',autocompleteclose,false); } } Quote Link to comment Share on other sites More sharing options...
WorldDrknss Posted September 24, 2007 Author Share Posted September 24, 2007 I thought I solved it, but it creates a conflict with the setvalue function and about auto suggestion function. Quote Link to comment Share on other sites More sharing options...
WorldDrknss Posted October 9, 2007 Author Share Posted October 9, 2007 bump Quote Link to comment Share on other sites More sharing options...
fenway Posted October 10, 2007 Share Posted October 10, 2007 I thought I solved it, but it creates a conflict with the setvalue function and about auto suggestion function. What does that mean/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.