Here's my relevant code:
var dropdown = {
init: function() {
$(".dropdown").click(".dropdown", dropdown.openDropdown, dropdown.secondFunction);
},
openDropdown: function() {
...
}
}
How can I call multiple functions on the click event? I added what I tried to do above.
EDIT:
So this is my new code with your guys help, and I can confirm both functions are being called because when I put alerts in they both trigger, but for some reason the code inside openDropdown right now isn't working. Is it because my $(this) references are off or something?
var dropdown = {
init: function() {
$(".dropdown").click(".dropdown", function() { dropdown.openDropdown(); dropdown.closeDropdowns(); });
},
openDropdown: function() {
$(this).children(".dropdown-menu").show();
$(this).addClass("open");
},
closeDropdowns: function() {
//$(".open").removeClass(".open");
//$(".open").children(".dropdown-menu").hide();
}
}
$(".dropdown").click(".dropdown", ...);isn't right.