• Hi, I need to call a jQuery java script file on my arras theme for a menu Im installing. the file is called ‘jquery-1.3.2.js’but for some reason calling it is breaking some of the other plugins I have running on my site such as Tabber widgets. can someone please let me know how to call that jquery file and then write the following code whilstavoiding the conflict, cheers in advance.

    need to call ‘jquery-1.3.2.js

    javascrip:

    <script type="text/javascript">
                $(function() {
                    var d=300;
                    $('#navigation a').each(function(){
                        $(this).stop().animate({
                            'marginTop':'-80px'
                        },d+=150);
                    });
    
                    $('#navigation > li').hover(
                    function () {
                        $('a',$(this)).stop().animate({
                            'marginTop':'-2px'
                        },200);
                    },
                    function () {
                        $('a',$(this)).stop().animate({
                            'marginTop':'-80px'
                        },200);
                    }
                );
                });
            </script>

    the site is zatheka.com, really appreciate some help

Viewing 3 replies - 1 through 3 (of 3 total)
  • WordPress already includes jQuery, so including another, older version of jQuery will cause problems.

    You should also look at this: https://digwp.com/2009/06/including-jquery-in-wordpress-the-right-way/ for information on using jQuery in WordPress using a noConflict wrapper to avoid trouble, and not using the ‘$’ shortcut. Brief psuedo-code sample:

    var $j = jQuery.noConflict();
    
    $j(function(){
    
        var d=300;
        $j('#navigation a').each(function(){
            $j(this).stop().animate({
    
         ...
    
    });
    Thread Starter kaine

    (@kaine)

    thanks for your response, question is though if jquery is already included then why is the menu not working without it, if it isnt too much trouble could you show me a no conflict version of the script i have posted using the $ shortcut, million thanks

    This is becoming more a jQuery question than a WordPress one, but you’d be looking at something like this:

    <script type="text/javascript">
        var $j = jQuery.noConflict();
    
        $j(document).ready(function() {
            var d=300;
            $j('#navigation a').each(function(){
                $j(this).stop().animate({
                    'marginTop':'-80px'
                },d+=150);
            });
    
            $j('#navigation > li').hover(
            function () {
                $j('a',$j(this)).stop().animate({
                    'marginTop':'-2px'
                },200);
            },
            function () {
                $j('a',$j(this)).stop().animate({
                    'marginTop':'-80px'
                },200);
            });
         });
    </script>

    I can’t speak to the fitness of this in the context of your site. You have a ton of JS loading. If you continue to have issues, you might want to try turning some plugins off and see if the problem goes away.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘calling jquery file breaking other site plugin appearance’ is closed to new replies.