Skip to content Skip to sidebar Skip to footer

Jquery Colorbox - Redirect/forward Inside Existing Colorbox

So I have a colorbox loaded. I'd like to be able to redirect/forward to another page inside the existing colorbox. window.location = href; won't work here. EDIT: Being more specifi

Solution 1:

You're almost there, but there's a couple reasons why that code isn't working.

One is that you are trying to load content from another domain without the proper options. In order to do that, you need to set the iframe:true, width, and height. If you are loading content from your own domain, then you may not need the iframe option (and then colorbox will be able to automatically determine width and height). If all the necessary css or js is loaded, then you don't need it. If your new page has some css or js in its <head> that's not already loaded, then you'll need the iframe.

The other problem is not a mistake, but how google handles requests. Which is to say in the case of loading their site in an iframe, they don't; they will block the request, so you will not be able to use google with colorbox (without creative handling). Incidentally, although it's handled differently, stackoverflow won't allow it either, so don't bother putting that one in either.

In any case, your colorbox redirect (in your post callback) should look like this:

$.colorbox({href:'http://www.yahoo.com', iframe:true, width:"75%", height: "75%"});

Solution 2:

have a look at the Inline HTML example on http://jacklmoore.com/colorbox/example3/


Post a Comment for "Jquery Colorbox - Redirect/forward Inside Existing Colorbox"