Is your code set in the jquery ready() event ?
<script>
$(document).ready(function() {
$(".cover").colorbox({ iframe:true, innerWidth:"400px", innerHeight:"400px"});
});
</script>
質問
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
});
});
解決
Is your code set in the jquery ready() event ?
<script>
$(document).ready(function() {
$(".cover").colorbox({ iframe:true, innerWidth:"400px", innerHeight:"400px"});
});
</script>