Reputation: 896
I am surely missing something easy as I am a relative noob at this. Help is appreciated! I am trying to get anything from the JQuery UI to work and nothing will. JQuery and JQuery UI both load without errors. But I can't seem to use any JQuery UI method successfully. Here's the loads from the head of the page:
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'></script>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js'></script>
Here's a jsfiddle as an example where I'm just trying to toggle a class on mouseenter. http://jsfiddle.net/8WTaW/1/ What is wrong? Thanks!
Upvotes: 1
Views: 80
Reputation: 1183
You need to capitalize the 'c' in 'toggleclass' in your code. Javascript is a case-sensitive language, and thus the proper method invocation will be 'toggleClass':
$(function () {
$('.navs').mouseenter(function () {
$(this).toggleClass('navshover');
});
});
http://api.jquery.com/toggleClass/
Upvotes: 3
Reputation: 207901
Capital "C".
It's
$(this).toggleClass('navshover');
not
$(this).toggleclass('navshover');
(and note, you don't need jQueryUI for this particular example.)
Upvotes: 2