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
  });
});
Était-ce utile?

La solution

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

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

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

  });
</script>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top