I am trying to load wordpress post in div using ajax but the jQuery inside it wont work after loading the content. For example i have accordian and slider in loaded page, they also dont work. And also the close button for the loaded div not working too.
I checked this post too Jquery event handler not working on dynamic content
But no sucess.
portfolio.php
<div id="fff">
</div>
<h2 class="ow-heading"><?php the_title(); ?></h2>
    <?php the_content(); ?>
<ul class="projectlist clearfix" id="<?php global $post; $post_slug=$post->post_name; echo $post_slug; ?>">
<?php
global $wp_query;
query_posts( array('post_type' => array( 'portfolio' ),'showposts' => 12, 'paged'=>$paged )
);
if (have_posts()) : while (have_posts()) : the_post();
?>
<li class="project">
    <a href="<?php the_permalink(); ?>" data-post="" rel="<?php the_ID(); ?>" class="ajax" data-toggle="modal" data-target="#myModal">
        <?php if ( has_post_thumbnail() ) { ?>
        <?php the_post_thumbnail(); ?>
        <?php } ?> 
        <div class="projectinfo">
            <div class="meta">
                <h4><?php the_title(); ?></h4>
                <h6><em><?php echo get_post_meta($post->ID, "spq_portfolio_tag", true) ?></em></h6>
            </div>
        </div>
    </a>
</li>
<?php endwhile; ?>
<?php else: ?>
<p><?php _e("Sorry, no posts matched your criteria.","arclite"); ?></p>
<?php endif; wp_reset_query(); ?>
</ul>
single-portfolio.php
<?php get_header(); ?>
  <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
  <div class="sparq-main">
    <div class="insparq-main">
      <h1 class="portfolio-single-title"><?php the_title(); ?></h1>
      <?php the_content(); ?>
    </div>
  </div>
<?php endwhile; endif; ?>
<?php get_footer(); ?>
custom.js
jQuery.noConflict();
jQuery(document).ready(function(){
/*----------------------------------------------------*/
/* Sticky Navigation
/*----------------------------------------------------*/ 
jQuery(".bottommenu").sticky({ topSpacing: 0 });
/*----------------------------------------------------*/
/* Slab Text
/*----------------------------------------------------*/  
function slabTextHeadlines() {
jQuery("h1.tagline").slabText({
      "viewportBreakpoint":380
    });
};
jQuery(window).load(function() {
    setTimeout(slabTextHeadlines, 1000);
});
/*----------------------------------------------------*/
/* Parallax
/*----------------------------------------------------*/
jQuery('.sep, .header').each(function(){
   jQuery(this).parallax("100%", 0.3); 
});
/*----------------------------------------------------*/
/* Accordion
/*----------------------------------------------------*/
jQuery('.accordion').each(function(){
      var acc = jQuery(this).attr("rel") * 2;
      jQuery(this).find('.accordion-inner:nth-child(' + acc + ')').show();
       jQuery(this).find('.accordion-inner:nth-child(' + acc + ')').prev().addClass("active");
});
jQuery('.accordion .accordion-title').click(function() {
      if(jQuery(this).next().is(':hidden')) {
          jQuery(this).parent().find('.accordion-title').removeClass('active').next().slideUp(200);
          jQuery(this).toggleClass('active').next().slideDown(200);
      }
      return false;
});
/*----------------------------------------------------*/
/* Custom Scroll
/*----------------------------------------------------*/
jQuery("html").niceScroll({cursorborder:"0px solid #fff",cursorwidth:"10px",scrollspeed:"70"});
/*----------------------------------------------------*/
/* Flex Slider
/*----------------------------------------------------*/
jQuery('.testi').flexslider({
    selector: ".slides > li",
    directionNav: false 
});
/*----------------------------------------------------*/
/* Navigation Scroll to Section
/*----------------------------------------------------*/
  var device = navigator.userAgent.toLowerCase();
  var ios = device.match(/(iphone|ipod|ipad)/);
 //function that returns element's y position
    jQuery("a[href*=#]").on('click', function(e) {
      var scrollTarget = jQuery(this.hash).offset().top;
      if(scrollTarget) 
          e.preventDefault();
        if(parseInt(scrollTarget) !== parseInt(jQuery(window).scrollTop())) {
          var nav2 = jQuery("nav");
        if (ios) nav2.hide();
          jQuery('html,body').animate({scrollTop:scrollTarget}, 1000, "swing", function(evt) {
          if (ios) {
            if(scrollTarget == 0) 
                nav2.css({position:'absolute', top:jQuery("#intro").height()});
            else
                nav2.css({position:'absolute', top:scrollTarget});
            var nav2clone = jQuery("nav")
            nav2clone.show();
          }
      });
    }
    });
    if (ios) {
        jQuery(document).bind('touchmove',function(){
          var intro = jQuery("#intro"), nav2 = jQuery("nav");
          console.log(nav2.position().top);
        if(intro.height() != nav2.position().top)
        {
            nav2.css({position:'fixed', top:'0px'});
            console.log(nav2.position().top);
        }
        else
        {
            nav2.css({position:'relative', top: ''});
        }
      });   
    }
/*----------------------------------------------------*/
/* Fit Video Responsive
/*----------------------------------------------------*/
jQuery(".spq-video").fitVids();
});
Ajax Call
jQuery("a.ajax").on('click', function(e) {
    e.preventDefault();
    var url = jQuery(this).attr("href");
    jQuery.get(url, function(data) {
      jQuery("#fff").show(600).html(data);
      var scrollTarget = jQuery("#fff").offset().top;
          jQuery('html,body').animate({scrollTop:scrollTarget-80}, 1000, "swing");
    });
  });
After the page content load with ajax, all the elements associated with custom.js not working, like slider, accordion etc.. which are on loaded content stopped working.
 
     
     
    