JQuery, WordPress and MAMP
-
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
- The topic ‘JQuery, WordPress and MAMP’ is closed to new replies.