I can’t seem to get this to work. I want to be able to fade div out if inactive or if a user clicks outside the div.,…
Here is the script using jquery 1.3.1
jQuery.noConflict();
google.setOnLoadCallback(function()
{
// Fade out the suggestions box when not active
jQuery("input").blur(function(){
jQuery('#suggestions').fadeOut();
});
// Fade out the suggestions box when click outside
jQuery("input").click(function(){
jQuery('#suggestions').fadeOut();
});
});
function lookup(inputString) {
if(inputString.length == 0) {
jQuery('#suggestions').fadeOut(); // Hide the suggestions box
} else {
jQuery.post("frontsearch.php", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
jQuery('#suggestions').fadeIn(); // Show the suggestions box
jQuery('#suggestions').html(data); // Fill the suggestions box
});
}
}
Have been searching around trying to figure out how to aproach this “mouseleave” been can’t figure it out… Can somebody please help i regards to my script…?