WordPress.org

Ready to get started?Download WordPress

Forums

JQuery, WordPress and MAMP (2 posts)

  1. Kondwani
    Member
    Posted 5 years ago #

    I'm developing a site using WordPress on a Mac, using MAMP and having problems getting JQuery to function. I'm not sure if this is due to an error I'm making with my coding or something to do with MAMP.

    Code snippet follows.

    <?php wp_enqueue_script('jquery'); ?>

    <!-- Javascript for fade effect on main navigation -->
    <script type="text/javascript">
    jQuery(function() {
    // set opacity to nill on page load
    jQuery("ul#menu span").css("opacity","0");
    // on mouse over
    jQuery("ul#menu span").hover(function () {
    // animate opacity to full
    jQuery(this).stop().animate({
    opacity: 1
    }, 'slow');
    },
    // on mouse out
    function () {
    // animate opacity to nill
    jQuery(this).stop().animate({
    opacity: 0
    }, 'slow');
    });
    });
    </script>

    <?php wp_head(); ?>

    </head>

    Any advice appreciated,

    Martin

  2. nintensity
    Member
    Posted 5 years ago #

    I need help as well.. any advice would be apreciated!
    bascially the function call in the head document isn't connecting with the javascript.. there has to be another way somehow...

Topic Closed

This topic has been closed to new replies.

About this Topic