0

jQuery quicksand プラグインを使用していますが、何が起こっているのか完全に理解できないという jQuery エラーが発生しています。ここにエラー「Uncaught Error: HierarchyRequestError: DOM Exception 3」がありますが、親ノードの問題に関係していることはわかっていますが、修正方法が完全に途方に暮れています。

これは、jQuery Quicksand でアイテムをフィルター処理するために使用しているコードです。フィルタリングは時々機能しますが、かなり奇妙でランダムです。機能する場合もあれば、アイテムを非表示にする場合もありますが、それでもスペースを占有するため、多くの空白が残ります。何かが正しくありません...何が起こっているかについてもっと情報があればいいのにと思います。

どんな助けでも大歓迎です!ありがとうございました!

<script type="text/javascript">
$(document).ready(function() {
  // get the action filter option item on page load
  var $filterType = $('#filterOptions li.active a').attr('class');

  // get and assign the ourHolder element to the
  // $holder varible for use later
  var $holder = $('ul.ourHolder');

  // clone all items within the pre-assigned $holder element
  var $data = $holder.clone();

  // attempt to call Quicksand when a filter option
  // item is clicked
  $('#filterOptions li a').click(function(e) {
    // reset the active class on all the buttons
    $('#filterOptions li').removeClass('active');

    // assign the class of the clicked filter option
    // element to our $filterType variable
    var $filterType = $(this).attr('class');
    $(this).parent().addClass('active');
    if ($filterType == 'all') {
      // assign all li items to the $filteredData var when
      // the 'All' filter option is clicked
      var $filteredData = $data.find('li');
    }
    else {
      // find all li elements that have our required $filterType
      // values for the data-type element
      var $filteredData = $data.find('li[data-type=' + $filterType + ']');
    }

    // call quicksand and assign transition parameters
    $holder.quicksand($filteredData, {
      duration: 800,
      easing: 'easeInOutQuad'
    });
    return false;
  });
});
</script>
4

0 に答える 0