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 Link to comment https://forums.phpfreaks.com/topic/70422-mouse-event/ 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); } } Link to comment https://forums.phpfreaks.com/topic/70422-mouse-event/#findComment-353809 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. Link to comment https://forums.phpfreaks.com/topic/70422-mouse-event/#findComment-353812 Share on other sites More sharing options...
WorldDrknss Posted October 9, 2007 Author Share Posted October 9, 2007 bump Link to comment https://forums.phpfreaks.com/topic/70422-mouse-event/#findComment-365737 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/ Link to comment https://forums.phpfreaks.com/topic/70422-mouse-event/#findComment-366222 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.