I have a function in my jQuery for my wordpress site. It's in my main.js and above document.ready and my main.js is being loaded after jQuery loads.
Everything works in my static version of the site, it doesn't work when I try to implement it in my theme in wordpress
The function:
It gives this error in my console:
<blockquote>
Uncaught TypeError: $ is not a function`
</blockquote>
When I try to replace the
with
I get no errors in my console but it doesn't work. Anyone knows what's going on here?
Thanks in advance!
Everything works in my static version of the site, it doesn't work when I try to implement it in my theme in wordpress
The function:
Code:
function toggleChevron(e) {
$(e.target)
.prev('.panel-heading')
.find("i.indicator")
.toggleClass('glyphicon-triangle-bottom glyphicon-triangle-left');
}
$('#accordion').on('hidden.bs.collapse', toggleChevron);
$('#accordion').on('shown.bs.collapse', toggleChevron);
It gives this error in my console:
<blockquote>
Uncaught TypeError: $ is not a function`
</blockquote>
When I try to replace the
Code:
$
Code:
jQuery
Thanks in advance!