• 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.