I’m getting an error that says “Uncaught typeError: cannot call method ‘hover’ of null” after
$('#nav li a').hover(function(){ in my javascript.
site code: http://pastebin.com/GjZBEu3s
jsfiddle: http://jsfiddle.net/jenga/5rfCC/2/
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You scripting should be in the body of the document, right before the closing
</body>tag. If it’s loaded in the<head>, the elements it addresses in the document may not be loaded yet. See this jsfiddle (notice ‘no wrap (body)’ in the ‘Choose framework’ dialog).By the way, a similar effect could be achieved using css only. Use this jsfiddle in a Chrome/webkit browser.