Question

I've got a more complicated Colorbox but as a test I can't even get this to work.

What is wrong with my code? Have I missed something out?

HTML

<a class="cover" href="http://www.bbc.co.uk">
    bbc
</a>

JavaScript

$(document).ready(function(){
  $(".cover").colorbox({
    iframe: true,
    innerWidth: 400,
    innerHeight: 400
  });
});
Was it helpful?

Solution

Is your code set in the jquery ready() event ?

<script>
  $(document).ready(function() {

      $(".cover").colorbox({ iframe:true, innerWidth:"400px", innerHeight:"400px"});

  });
</script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top