In HTML
I have the following:
<div class="row">
<ul class="simplefilter">
Simple filter controls:
<li class="active" data-filter="all">All</li>
</ul>
</div>
<div class="row">
<div class="filtr-container">
</div>
</div>
and in a file JS
:
for (var i = 0; i < 6; i++)
{
$(".simplefilter").append("<li class='d' data-filter='"+[i]+"'>Cityscape</li>"); // ESTE FUNCIONA BIEN
$(".filtr-container").append("<div class='col-xs-6 col-sm-4 col-md-3 filtr-item' data-category='"+[i]+"' data-sort='Busy streets'><img class='img-responsive' src='img/city_1.jpg' alt='sample image'><span class='item-desc'>Busy Streets</span></div>");
};
the class simplefilter
is traveling 5 times as indicated by the for and works perfectly but the class filtr-container
is not 'taking' the method append
and if I use the method html
only what walk once.
That's why this, if I'm also going through [i]
in data-category='"+[i]+"'
?
The error that appears to me is the following:
jquery.filterizr.js:414 Uncaught TypeError: Cannot read property 'push' of undefined
at n.fn.init._makeSubarrays (jquery.filterizr.js:414)
at Object.init (jquery.filterizr.js:159)
at n.fn.init.$.fn.filterizr (jquery.filterizr.js:84)
at HTMLDocument.<anonymous> (david:92)
at i (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at Function.ready (jquery.min.js:2)
at HTMLDocument.K (jquery.min.js:2)
I would appreciate the interest.