0

i am trying to add wookmark layout in my angular js app .If there is no infinity scroll then it will fine but when i added angularjs infinity scroll then my wookmark layout not working means when scroll layout not apply .

my infinity scroll function code -

$scope.onload = function() {
$scope.paramUrl = $location.url(); 
$scope.apiurl = $scope.apiurl+$scope.paramUrl; 
if ($scope.paramUrl) {
  $http({method: 'GET',url:$scope.apiurl}).success(function(data) {
    $scope.productData = data.deals; 
    $scope.qitem = data;  
  });
}
else 
{
  $http({method: 'GET', url: $scope.url}).success(function(data) {    
    $scope.productData = data.deals;       
  });
}  

};

and my jquery wookmark code -

$(window).load(function() {
setTimeout(function() {
    (function ($){
      var handler = $('#tiles li');
      handler.wookmark({          
          autoResize: true,
          container: $('#main_pro_content'), 
          offset: 11, 
          outerOffset: 0, 
          itemWidth: 200,
          fillEmptySpace: true
      });     
    })(jQuery);
 }, 500);

});

Himanshu
  • 85
  • 1
  • 8
  • Your onload function is only being run once. So when new elements are added to the DOM the function is not being applied. The correct way to fix this is to make wookmark a directive. – Enzey Apr 22 '15 at 17:13
  • i am already create directive as you say . but when i add directive all images overlap . – Himanshu Apr 23 '15 at 07:02

0 Answers0