Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Loading new slider with AJAX on click from selection

I am using SwiperJS and I'm trying to use jQuery load() to get the images from the folder.

The problem is that it doesn't display all the images on the sliders.

I basically have a side widget and you can choose to show a different set of images based on user selection.

Here's the code

<script> 

$(document).ready(function(){
           $("#vossenclick").click(function(){
            $('#carpartz').load('vossen.html');
             //alert("Thanks for visiting!");
           }); 

           $("#enkeiclick").click(function(){
            $('#carpartz').load('enkei.html');
             //alert("Thanks for visiting!");
           });
         });
</script>

This is the html i want to load:

<div class="swiper-slide"><img  src="img/Vossen/cv3graphite.png"></div>

<div class="swiper-slide "><img src="img/Vossen/cv3silver.png"></div>
                                  <div class="swiper-slide"> <img src="img/Vossen/vossenbrushed.png"></div>
                                 <div class="swiper-slide"> <img src="img/Vossen/vossenglossgraphite.png"></div>
                                <div class="swiper-slide"> <img src="img/Vossen/vossenpolished.png"></div>
                                <div class="swiper-slide"> <img src="img/Vossen/vossensatinbronze.png"></div>

The problem is that it doesn't load all the images into the div