I have the following code in my app.js:
$scope.myData.mouseLeave = function(event) {
var el = document.getElementById(event.target.id);
console.log("hey, i'm running");
el.style.backgroundColor = '#aabbcc';
};
$scope.myData.mouseClick = function(event) {
console.log("yes I am also running");
var header = document.getElementById(event.target.id);
//getting the next element
var content = header.nextSibling;
if (content.classList.contains("container")) {
//open up the content needed - toggle the slide- if visible, slide up, if not slidedown.
$(content).slideToggle(500);
}
};
});
The mouseLeave works fine, but as I am trying to use a JQuery function in the mouseClick function, it is giving me the error in the browser that slideToggle is not a function. I've searched around and can't find really anything on this except one SO question that was not helpful. I am loading jquery before calling my js code so I'm not sure what the problem is.
How can I get slideToggle to work in my code?