Hi dcooney,
Thanks for the reply, I don’t think that is it, the code I’m using is:
jQuery(document).ajaxComplete(function () {
jQuery('.hideshow .expand').css('display','none');
jQuery('.expandBtn span').removeClass('rotate');
// Watch for clicks on the "slide" link.
//jQuery('.hideshow').click(function () {
jQuery('.milestone-background').on('click', '.hideshow', function(event){
event.preventDefault();
jQuery(this).find('span').toggleClass('rotate');
if(jQuery(this).next('.expand').css('display') === 'none'){
jQuery(this).next('.expand').slideDown(400);
}
else if(jQuery(this).next('.expand').css('display') === 'block'){
jQuery(this).next('.expand').slideUp(400);
}
});
var firstyear = jQuery('.milestone').data('year');
jQuery('.milestones-container .first span').html(firstyear);
var lastyear = jQuery('.milestone').last().data('year');
jQuery('.milestones-container .update-year').html(lastyear);
});
so basically it’s kind of a timeline with various events on various years and each event has a click function that shows the full content, it works fine when page is initially loaded, but after the ajax load more has run, the click event opens the content then closes it straight away, I’m sure it’s something to do with the if else but not sure what.
Thanks
Sibbo100