Call a function init and when Isotope finishes and then reset on next run

237
June 22, 2017, at 08:35 AM

I'm looking to run a function before/on init and then as soon Isotope finishes animating and then as soon as isotope is triggered again to reset the function so that it reflects the new layout 'onLayout'. The following code will run when Isotope finishes, but it keeps and multiplies out the function multiple times which is not what I'm looking for:-

$(".grid").bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(){
 // the function
$('.2017').wrapAll( '<div class="year2017"></div>' );
$('.year2017').before('<div class="yeardiv"><h2>2017</h2></div>');
});
// bind event listener
$isotope.isotope( 'on', 'layoutComplete', onLayout );    

So basically it's not resetting keeps duplicating it out (so in this case multiple 'yeardiv's), but what I want is it only to run on init and once Isotope has finished its layouts so that it repeatedly correctly groups divs with the same year class once isotope has finished.

Make sense?

Thanks Glennyboy

Rent Charter Buses Company
READ ALSO
Remove a connection between two nodes

Remove a connection between two nodes

I'm trying to remove an existing connection(DragConnectionCreatePolicy) between two nodesI tried two ways, the first using this command:

358
Jquery Bootstrap Pagination and also Search

Jquery Bootstrap Pagination and also Search

I created simple table in html page , where lots of data i want to use Jquery Bootstrap Pagination and Show data, how can i add bootstrap pagination and also search in this table, my html table code is below

406
How to incorporate 2nd div into 1st div to be visible and collapsed pressing an arrow button

How to incorporate 2nd div into 1st div to be visible and collapsed pressing an arrow button

I am trying to achieve what could be for you guys a simple task

255
jquery-ui draggable interfering with touch scroll

jquery-ui draggable interfering with touch scroll

It's my understanding that jQuery UI totally ignores touch events and people wanting to use touch events have had to use touch-punch to map touch events into mouse eventsHowever, the newer versions of UI seem to be interfering with built in touch events...

396