Title: Javascript problem
Last modified: August 31, 2016

---

# Javascript problem

 *  [17Mark](https://wordpress.org/support/users/17mark/)
 * (@17mark)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/javascript-problem-14/)
 * Hi, I have problems with JavaScript. In the code below you can see my JS scripts
   which I use. Everything works but the animations in second script don’t working.
   Only is set in css background position to 0 -6em.
 *     ```
       jQuery(document).ready(function($){
   
       $('.crop p').hover(
   
       function () {
       $(this).animate({opacity:'1'}, 300);
       },
   
       function () {
   
       $(this).animate({opacity:'0'}, 300);
   
       }
   
       );
   
       $('#menu li a')
       .css( {backgroundPosition: "0 -6em"} )
       .mouseover(function(){
       $(this).stop().animate(
       {backgroundPosition:"(0 0)"},
       {duration:500})
       })
       .mouseout(function(){
       $(this).stop().animate(
       {backgroundPosition:"(0 -6em)"},
       {duration:200})
       })
   
       });  
   
       And there are too scripts from head
       ```
   
 * <script type=”text/javascript” src=”<?php bloginfo(‘template_url’); ?>/scripts.
   js”></script>
    <?php wp_enqueue_script(‘jquery’); ?> <?php wp_head(); ?>

The topic ‘Javascript problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [17Mark](https://wordpress.org/support/users/17mark/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/javascript-problem-14/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
