{"id":4374975,"date":"2013-12-03T12:56:09","date_gmt":"2013-12-03T12:56:09","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/how-to-make-jquery-function-work\/"},"modified":"2016-08-21T13:09:16","modified_gmt":"2016-08-21T13:09:16","slug":"how-to-make-jquery-function-work","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/how-to-make-jquery-function-work\/","title":{"rendered":"How to make jQuery function work?"},"content":{"rendered":"<p>I desperately need help with making a small piece of jQuery code work.<br \/>\nThis is the original script code:<\/p>\n<pre><code>$(document).scroll(function () {\n    var x = $(this).scrollLeft();\n    if (x &gt; 100) {\n        $(&#039;.topMenu&#039;).fadeIn(300);\n    } else {\n        $(&#039;.topMenu&#039;).fadeOut(300);\n    }\n\n});<\/code><\/pre>\n<p>I allready have a child theme in place. I&#8217;ve tried by creating a .js file (in a child theme js folder) plus a child theme functions.php, after reading several sources on this forum, but without succes. It&#8217;s difficult for me to &#8216;translate&#8217; given examples to my specific code. What should go where?<\/p>\n<p>Thanks!!<\/p>\n","protected":false},"template":"","class_list":["post-4374975","topic","type-topic","status-closed","hentry","topic-tag-functions","topic-tag-javascript","topic-tag-jquery"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4374975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4374975\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4374975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}