The code below works on a live site but I can\'t get it to run on the site jsfiddle .
See this for example.
Can anyone tell me why it\'s not working on jsfid
In your fiddle select no wrap (head) in the dropdown on the left, click Run and it will work.
no wrap (head)
See example →
When onLoad is selected your functions are defined within the closure of the $(document).ready(function() {}); only.
onLoad
$(document).ready(function() {});