I installed this script: https://www.webslesson.info/2017/03/load-content-while-scrolling-with-jquery-ajax-php.html
it works well but I have a problem with Bootstrap I can't align the columns
I modified the code in the while loop with this:
echo '<div class="border box col-3 m-1 mx-auto p-2 rounded text-center">';
echo ' <span>'. $row['post_title'] .'</span> <br />';
echo '<span class="small">'. $row['post_description'] .'<br />'. $row['post_author'] .'</span>';
echo '</div>';
And I modified the index.php file to add two divs with a class 1 container & 1 row In theory the result should look like this:
Result.1 | Result.2 | Result.3 | Result.4
Result.5 | Result.6 | Result.7 | Result.8
etc ... But instead I have this:
- Result.1
- Result.2
- Result.3
- Result.4
etc ...
I'm looking for it but I can't find where the problem comes from when I test in HTML without PHP & AJAX the divs are displayed well next to each other and not below each other so the problem lies elsewhere.
row
element to work properly. Try and add that class to the#load_data
element, and see how it looks then..row
div after the#load_data_message
element, and then change the JS code to$('#load_data .row').append(data);
and see if that helps ...