Title: Specific JavaScript not working
Last modified: August 22, 2016

---

# Specific JavaScript not working

 *  Resolved [tomicicivan](https://wordpress.org/support/users/tomicicivan/)
 * (@tomicicivan)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/specific-javascript-not-working/)
 * Hello,
 * I have this specific code that is not working in my wordpress, other scripts 
   are working as on static page, but this one is not, do you guys know why?
 * Thank you SO MUCH!!!
 *     ```
       $(document).scroll(function () {
           var y = $(this).scrollTop();
           if (y > 200) {
               $('.floatnav').fadeIn();
           } else {
               $('.floatnav').fadeOut();
           }
       });
       ```
   

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [gotgotf](https://wordpress.org/support/users/gotgotf/)
 * (@gotgotf)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/specific-javascript-not-working/#post-5270720)
 * what is your URL please ?
 *  Thread Starter [tomicicivan](https://wordpress.org/support/users/tomicicivan/)
 * (@tomicicivan)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/specific-javascript-not-working/#post-5270721)
 * I’m working on localhost right now :/ Is there any info that I can provide or
   I have to upload to hosting now?
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [11 years, 7 months ago](https://wordpress.org/support/topic/specific-javascript-not-working/#post-5270723)
 * Replace `$` with `jQuery`.
 *  [gotgotf](https://wordpress.org/support/users/gotgotf/)
 * (@gotgotf)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/specific-javascript-not-working/#post-5270726)
 * this is not set !
 * $(window).scroll(function (event) {
    var y = $(window).scrollTop(); if (y > 200){
   $(‘.floatnav’).fadeIn(); } else { $(‘.floatnav’).fadeOut(); } });
 * OR
 * jQuery(window).scroll(function (event) {
    var y = jQuery(window).scrollTop();
   if (y > 200) { jQuery(‘.floatnav’).fadeIn(); } else { jQuery(‘.floatnav’).fadeOut();}});
 * and better / jQuery(‘.floatnav’)**.stop()**.fadeIn();
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 7 months ago](https://wordpress.org/support/topic/specific-javascript-not-working/#post-5270729)
 * Useful:
    [http://codex.wordpress.org/Using_Javascript](http://codex.wordpress.org/Using_Javascript)
   [http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers](http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers)
 *  Thread Starter [tomicicivan](https://wordpress.org/support/users/tomicicivan/)
 * (@tomicicivan)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/specific-javascript-not-working/#post-5270736)
 * gotgotf, this worked, thank you so much!
 *  [gotgotf](https://wordpress.org/support/users/gotgotf/)
 * (@gotgotf)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/specific-javascript-not-working/#post-5270738)
 * oh, cool, thanks
 *  [gotgotf](https://wordpress.org/support/users/gotgotf/)
 * (@gotgotf)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/specific-javascript-not-working/#post-5270850)
 * add resolved please.
 *  Thread Starter [tomicicivan](https://wordpress.org/support/users/tomicicivan/)
 * (@tomicicivan)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/specific-javascript-not-working/#post-5270851)
 * Oh, sorry, didn’t know how it works, thanks.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Specific JavaScript not working’ is closed to new replies.

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 4 participants
 * Last reply from: [tomicicivan](https://wordpress.org/support/users/tomicicivan/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/specific-javascript-not-working/#post-5270851)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
