Jquery in wordpress not working?
-
Hello everyone,
I have been at it all day but it’s not functioning the way I want it to function. I’m talking about a jquery script.
It’s the following:
// Begin jQuery $(document).ready(function() { alert ("helloworld"); $("#subscribe_sidebar_list a").hover(function() { $(this).stop().animate({ marginTop: "-10px" }, 200); $(this).parent().find("span").stop().animate({ marginTop: "18px" }, 200); },function(){ $(this).stop().animate({ marginTop: "0px" }, 300); $(this).parent().find("span").stop().animate({ marginTop: "1px" }, 300); }); // End jQuery });
It moves the ID subscribe_sidebar_list a when the mouse hovers over it.
The call looks like this in the header.php:
<?php wp_enqueue_script("jquery"); ?> <?php wp_head(); ?> <script type="text/javascript" src="<?php bloginfo("template_url"); ?>/js/execute.js"></script>
Is this wrong? Because my other Jquery is working (idTabs).
For your information:
HTML:<ul id="subscribe_sidebar_list"> <li class="button1"><a href="https://www.facebook.com" title="My fancy link">Link Text</a></li> <li class="button2"><a href="#" title="link">Link Text</a></li> <li class="button3"><a href="#" title="link">Link Text</a></li> </ul>
And CSS:
#subscribe_sidebar_list { float: right; width: 360px; height: 60px; list-style: none; list-style-type:none; margin-right: 15px; } #subscribe_sidebar_list li { float: left; width: 60px; height: 60px; display: block; padding-left: 5px; } #subscribe_sidebar_list a, #subscribe_sidebar_list a:visited, #subscribe_sidebar_list a:hover { overflow: hidden; display: block; text-indent: -9999px; width: 60px; height: 60px; } /* Button Types */ #subscribe_sidebar_list li.button1 { background: url(images/facebook.png) no-repeat; width: 60px; height: 60px; } #subscribe_sidebar_list li.button2 { background: url(images/twitter.png) no-repeat; width: 60px; height: 60px; } #subscribe_sidebar_list li.button3 { background: url(images/feed.png) no-repeat; width: 60px; height: 60px; }
script
Viewing 13 replies - 1 through 13 (of 13 total)
Viewing 13 replies - 1 through 13 (of 13 total)
- The topic ‘Jquery in wordpress not working?’ is closed to new replies.