[Solved] My script works in jsfiddle but not site. Cannot call method hover of null?


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.

0

solved My script works in jsfiddle but not site. Cannot call method hover of null?