Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2009
    Posts
    51
    Thanks
    6
    Thanked 0 Times in 0 Posts

    jQuery.noConflict Issue

    Hello,

    I'm having a jQuery conflict issue I'm unclear how to resolve. The problem is I've added some jQuery vertical tab code to one of my pages that's conflicting with one of my Wordpress plugins. I realize folks may not be familiar with Wordpress, but I think my issue is less to do with the blog than a conflict with jQuery.

    The plugin in question is WP-Lightbox 2. It references the WP installation (/wp-includes/js/jquery) of jQuery. The last line of that file contains "jquery.noconflict;". When I remove this line, Lightbox 2 stops working - but my vertical tab code works. Add it back and Lightbox works, but my code doesn't. I've tried "$j=jquery.noConflict;" but that doesn't work either.

    So, my question is - what exactly does this line do and are there any alternatives I can use? Here's my vertical tab code:

    Code:
    <script type="text/javascript">
            $(function() {
                var $items = $('#vtab>ul>li');
                $items.mouseover(function() {
                    $items.removeClass('selected');
                    $(this).addClass('selected');
    
                    var index = $items.index($(this));
                    $('#vtab>div').hide().eq(index).show();
                }).eq(1).mouseover();
            });
    </script>

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Have a look here for what I suspect is the issue.

  • Users who have thanked SB65 for this post:

    billatl (11-06-2010)

  • #3
    New Coder
    Join Date
    Oct 2009
    Posts
    51
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Awesome job, thanks that worked!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •