views:

112

answers:

1

How can I open a jQuery colorbox with an external site loaded. I have tried:

jQuery(document).ready(function(){
jQuery.colorbox({ href:"http://www.google.com", iframe: true });
});

But with no success. I have not been able to find an example of this from either the colorbox-site or SO.

+1  A: 

Do you want the colorbox to open on the load of your page.

If yes You need to write.

jQuery.fn.colorbox instead of just jQuery.colorbox.

also specifcy width and height elements for your colorbox iframe.

http://colorpowered.com/colorbox/core/example1/index.html is having an example in Other Content Types section

sushil bharwani
I forgot to specify the height and width, and then it worked. Why should I use jQuery.fn.colorbox instead of jQuery.colorbox?
Dofs