I have successfully implemented a <ul>
drop-down list, but I am interested in making the list "retract" or disappear back to its original state when clicking away from it. Is this possible?
The code snippet below is what I currently have for the drop-down functionality. Since I'm not proficient in JavaScript, I'm unsure of how to achieve the desired retracting effect.
$(function(){
$('#select').click(function(){
$('#sel-option').show();
});
$('#sel-option a').click(function(e){
$('#select').text($(this).text());
$('#sel-option').hide();
$(this).addClass('current');
e.preventDefault();
})
})