我似乎无法正确设置custombox,并且做错了事。
码:

<link href="css/custombox.min.css" rel="stylesheet">

<section>
<div class="button">Click</div>
<div style="display:none;" class="open">WORD</div>
<script>
$(function() {
$('.button').on('click', function( e ) {
    Custombox.open({
        target: '.open',
        effect: 'fadein'
    });
    e.preventDefault();
});
});
</script>
</section>
<script type="text/javascript" src="js/custombox.min.js"></script>

最佳答案

Custombox不提供静态的open方法。您需要先初始化一个实例,然后再初始化open()

$('.button').on('click', function( e ) {
   var modal = new Custombox.modal({
      content: {
        effect: 'fadein',
        target: '.open'
      }
   });

   modal.open();
});


Fiddle

09-16 10:56