0
$(document).ready(function(){
        $("a[rel='box']").colorbox();
                });

and

jQuery('a[href*=#]').live('click',function() { ...etc...

total NOOB question: I have these two functions in JQuery...

How do I combine them ?

a[href*=#] is a slideshow presentation and a[rel='box'] is for a colorbox to open... one or the other works but not both together.

That is what I get for trying to "cut and paste" code...

the Jquery is loaded

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js">    </script>
<script type='text/javascript' src='scripts/jquery.colorbox-min.js'></script>

in the HEAD section

I even tried to add:

 jQuery(function(){
 if(jQuery.isFunction(jQuery.fn.colorbox)) {
    jQuery("a").live('click',function(){
         jQuery(this).colorbox();
     });
 }
 });

but this didn't work either...

This is where I got the slideshow... www.pixedelic.com/plugins/camera/ colorbox is loaded, but doesn't work on individual pictures...

Any help would be GREATLY appreciated and thanks!

Barmar
  • 596,455
  • 48
  • 393
  • 495

1 Answers1

0

The problem was defining $ in jQuery NOT an A conflict with READY and LIVE...

I think your copy of jquery.min.js is corrupted, it doesn't define $.

Your jQuery script ends with jQuery.noConflict();, that prevents defining $.

So you have to write jQuery(document).ready() instead of $(document).ready()

You can't write $.noConflict() after you already have jQuery.noConflict() in jquery.min.js.

SOLUTION:

 jQuery(document).ready(function($){            
        $("a[rel='box']").colorbox();
                });

NOT:

// cannot below use if have jQuery.noConflict(); !  use above notice large Q //
    $(document).ready(function(){
        $("a[rel='box']").colorbox();
        });

THANKS! Barmar!