Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
metaslider in bootstrap modal jumpy

I have a WordPress site where I put the content of a post inside a modal. The page worked great only, because there was so much information on the page, it took a VERY long time to load. So, I decided to populate the modal when the modal gets opened up. I figured out how to use ajax to populate the modal. Only, now, the slideshow in the modal makes it really jumpy. The content was not jumpy when I was loading all of the modals on the page at the same time. I think the slideshow images loaded using lazy load or some I do not know that much about jquery. I am sure there is a solution. Here is the code that populates the modal

<script type='text/javascript'>
$(document).ready(function(){
    $('.userinfo').click(function(){
        var post_id = $(this).data('id');
        $.ajax({
            url: '/ajax/',
            type: 'post',
            data: {post_id: post_id},
            success: function(response){ 
            $('#p111').html(response); 
            }
        });
    });
});
</script>

Here is the code on the wordpress template that generates page /ajax/

<?php
/**
 * Template Name: Ajax 
 */
if(isset($_POST['post_id']) && !empty($_POST['post_id'])){
  $post_id = $_POST['post_id'];
}
?>
    <div class="modal-dialog ">
      <div id="modal_mask"></div>
      <div class="modal-content">
          <div class="modal-body "><div class="container-fluid">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <div class="row">
              <div id="projectcontent" class="col-xs-12 no_pad">
              <?php
              echo '<div class="alignnormal">'.do_shortcode('[metaslider title="'.$post_id.'"]').'</div>';
              $post_object = get_post( $post_id );
              echo $post_object->post_content;
              ?>
              </div>
            </div>
          </div></div>
      </div>
    </div>
<?php
 wp_footer();
exit;
?>

I have worked on this for way tooooooo many hours...ugg

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!