I have the following two functions that do the same thing, any way I can combine these two functions into a single function?
$(document).ready(function(){
$("#nav li").click(function(e) {
e.preventDefault();
$("#nav li").removeClass("current_page_item");
$(this).closest("li").addClass("current_page_item");
});
$("#overlay li").click(function(e) {
e.preventDefault();
$("#overlay li").removeClass("current_page_item");
$(this).closest("li").addClass("current_page_item");
});
});
Thanks,
Josh