jQuery slider affecting WordPress menu

I was wondering if someone can help me out with this issue.
I have downloaded the NivoGallery and add it to a WP theme that I am building with Thematic Framework, but I have one small issue that I can’t fix.
As the title says, the jQuery added on the slider is disabling the JS of the standard WP-Thematic menu.
The code below is included with a function into the theme.

    <div id="gallery" class="nivoGallery">
        <ul>
            <li>...</li>
            <li>...</li>
            <li>...</li>
            <li>...</li>
        </ul>
    </div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="<?php bloginfo('stylesheet_directory'); 
?>/admin/js/jquery.nivo.gallery.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        $('#gallery').nivoGallery();
    });
</script>`

It mostly seems like the issue is caused by

Read More
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
</script>

I have tried with jQuery noConflict, but does not seem to work, it breaks.
Let me know if you need the entire html code and jquery.nivo.gallery.js file.

I have found this solution:
function add_js_for_slider() {
?>

/admin/js/jquery.nivo.gallery.js”>

$(document).ready(function() {
$(‘#gallery_slider’).nivoGallery();
});

Is possible to get rid of the jquery line, and still keep it working? Even if WP has jquery, if I remove that line from my function the slider breaks.

Related posts

Leave a Reply

1 comment

  1. jquery is already included in wordpress, therefore you don’t need to include it from googleapis.

    nivo gallery can handle jQuery noConflict. If you try that u just need to change $ to jQuery in your code.