a_minnie
a_minnie

Reputation: 11

colorbox wont open a lightbox, instead opening URL directly

I'm trying to open a google calendar using a lightbox. I've seen it done on another webpage using Colorbox (here: http://www.orovalleybicycle.com/ click on 'Expand to full calendar' on the righthand side), but when I tried to implement something really similar (also using colorbox) the calendar is refusing to open inside a colorbox. When I click on my hyperlink that SHOULD trigger colorbox it just navigates away from my page and opens the google calendar URL directly.

So basically, here is the relevant bits of my code... I've tried wherever possible to duplicate what's on the demo page ( http://www.jacklmoore.com/colorbox/example1/) so that i know it SHOULD work (except where you see relative URLs i have actually used absolute ones, changed for security & simplifiaction):

In my <head> tags:

<link rel="stylesheet" href="colorbox/colorbox.css" />

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="colorbox/jquery.colorbox.js"></script>

<script>
    $(document).ready(function(){
        $(".colorboxcal").colorbox({iframe:true, width:"80%", height:"80%", transition:"fade"});
    });
    </script>

In the body:

<a class="colorboxcal" href="https://www.google.com">Open Full Calendar</a>

But basically, it behaves as if it just says this:

<a href="https://www.google.com">Open Full Calendar</a>

I've tried the following things to work out what was causing the problem:

I would love to check whether the colorbox is actually being triggered or loaded at all, but I can't figure out how.

I've checked and my page validates nicely as xhtml (using w3 and using dreamweaver), so I dont think i've got any silly unclosed tags or anything causing problems. But it might possibly be something equally obvious that I've overlooked! I'm using php to call header & footer & navigation, and I have an image "slider" elsewhere on the site that uses javascript and jquery and its working fine. I've tried veiwing it (locally hosted) in firefox and chrome but the results are the same in both, so I don't think its related to a brower issue. My php is being errr... parsed (? whats the correct term there?) by xampp lite, but i googled and cant find any expected conficts there.

i started building this site as a complete novice to html, php, javascript, jquery - the lot, so apologies if you clever souls need to dumb-down your response... I'm an absolute noob and my head is swimming! But does anyone (please!) have any suggestions as to why the colorbox doesnt work??? Thankyou in advance!!

Upvotes: 1

Views: 1709

Answers (1)

Jack
Jack

Reputation: 9538

Some sites do not allow you to display them in an iframe, www.google.com being one of them.

Upvotes: 1

Related Questions