Функция Fire jquery после открытия Foundation Reveal - PullRequest
0 голосов
/ 29 октября 2018

Я использую Раскрытие Фонда , которое открывает модал, как я могу запустить следующий код после открытия модала?

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);
});

1 Ответ

0 голосов
/ 29 октября 2018

Вам нужно вызвать ваши функции на 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);
});

});
...