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:
- checked the absolute paths are correct
- tried changing the reference for jquery.min to a copy on my local machine, and tried different versions (made no difference)
- tried changing the 'href' to direct to an image on my pc (result: clicking the link opened the image in the brower window, so same old problem)
- moving the href attribute up into the
<script>
code at the top (result: clicking the link did nothing. wrong cursor dispayed and doesn't behave like a link, just text.) - putting the same code in a test page with nothing else but the bare essentials (result: clicking on link opened the URL, so same old issue.)
- tried removing all attributes that override .colorbox default ones except width & height (result: same old issue)
- tried removing the
ready(function()
stuff and placing the<script>
code just under the</a>
tags where it is needed (result: same old issue)
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!!