jQuery loading issues within wordpress

Posted by Chase on Stack Overflow See other posts from Stack Overflow or by Chase
Published on 2010-05-27T18:37:08Z Indexed on 2010/05/27 18:41 UTC
Read the original article Hit count: 313

Filed under:
|
|

I am having a couple problems trying to manually insert some jQuery features into a wordpress theme. I have a lightbox wordpress plugin that is jQuery based that is working fine.

So if I manually load the jQuery script into wordpress the functions seem to work but instead of say a slide being hidden it is revealed when it should still be hidden. Or a pop up that should work is already being shown instead of hidden. I don't think I'm supposed to manually include the jQuery into my skin but using the wp_enqueue_script('jquery'); doesn't seem to be resolving my issues either.

<script src="http://platform.twitter.com/anywhere.js?id=i5CnpkmwnlWpDdAZGVpxw&v=1" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function(){

    $(".btn-slide").click(function(){
      $("#twitpanel").slideToggle("slow");
      $(this).toggleClass("active");
    });

});
</script>

<div id="tweetit"><a class="btn-slide">Tell em'</a>
            <div id="twitpanel"></div>
            <script type="text/javascript">

              twttr.anywhere(function (T) {

                T("#twitpanel").tweetBox({
                  height: 100,
                  width: 225,
                  defaultContent: "Some Random Text"
                });

              });

            </script>

            </div></h2>

Like I said it works but in the reverse fashion that it should be.

I think I'm just loading in something wrong?

TIA, Chase

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery