Foundation Reveal 打开后触发 jquery 功能

Fire jquery function after Foundation Reveal has opened

我正在使用 Foundation's Reveal 打开模态框,如何在模态框打开后触发以下代码?

jQuery(document).foundation();

// Ensure all product code cells are the same height
$('.product-codes').each(function(){
  // Cache the highest
  var highestBox = 0;
  // Select and loop the elements you want to equalise
  $('.column-data', this).each(function(){
    // If this box is higher than the cached highest then store it
    if($(this).height() > highestBox) {
      highestBox = $(this).height();
    }
  });
  // Set the height of all those children to whichever was highest
  $('.column-data',this).height(highestBox);
});

您需要在 open.zf.reveal 事件

上调用您的函数
jQuery(document).on('open.zf.reveal',function(){

// Ensure all product code cells are the same height
$('.product-codes').each(function(){
  // Cache the highest
  var highestBox = 0;
  // Select and loop the elements you want to equalise
  $('.column-data', this).each(function(){
    // If this box is higher than the cached highest then store it
    if($(this).height() > highestBox) {
      highestBox = $(this).height();
    }
  });
  // Set the height of all those children to whichever was highest
  $('.column-data',this).height(highestBox);
});

});