jQuery Error HierarchyRequestError: DOM Exception 3-Collection of common programming errors

I am using the jQuery quicksand plugin and am running into a jQuery error that I completely don’t understand what’s going on. Here is the error “Uncaught Error: HierarchyRequestError: DOM Exception 3” I do however know it has to do with a parent node issue but I am completely at a loss at how to fix it.

Here is the code I’m using to filter my items in jQuery Quicksand. The filtering is working every once in a while but its pretty weird and random. Sometimes it works and other times it hides the items but they still take up space so it leaves a lot of white space. Something isn’t right… I wish I had more information as to whats going on.

Any help would be very much appreciated! Thank you!


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

Originally posted 2013-11-13 09:49:12.