To answer your question directly: yes, it's possible to combine them into one function.
Is it advisable in the way you presented though? No.
I would argue that anytime there's a function with hard coded functionality controls, something is probably wrong.
Consider this for example:
function someHandler() {
var $this = $(this);
if ($this.hasClass('class-a')) {
//do something specific to a
}
if ($this.hasClass('class-b')) {
//do something specific to b
}
if ($this.hasClass('class-c')) {
//do something specific to c
}
}
$(".class-a, .class-b, .class-c").click(someHandler);
The easiest way to illustrate why this is a problem is to consider what happens if you want to reuse any of the specific functionalities.
How would you reuse the functionality in the //do something specific to a
segment on something that doesn't have the class class-a
without copying and pasting the code? You couldn't. (Well, not cleanly anyway.)
For this reason, it's good to try to separate functionalities and their bindings:
function someHandlerA() {
//do something specific to a
}
function someHandlerB() {
//do something specific to b
}
function someHandlerC() {
//do something specific to b
}
$(".class-a").click(someHandlerA);
$(".class-b").click(someHandlerB);
$(".class-c").click(someHandlerC);
Now what if you want to reuse the functionality? It's easy: $("some selector").bind("some event", someHandler);
Obviously in large applications it becomes a lot more complex than this. There are of course times when it's ok to switch functionalities based on some condition. It's typically best to keep different functionalities as atomic as possible though. It relates back to the idea of separation of concerns. Each segment of code should do only one thing, even if that one thing is just dispatching to more than one thing.