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

wmuSlider responsive issue

Hi, I've been trying to implement wmuSlider in my own project, with four articles in it. It's going great, except it won't shrink to a smaller size when the window is resized, and so just overlaps other elements instead which looks awful. I've tried setting max and min widths using percentages, but frustratingly the first article is empty. The slider functions as it should from the 2nd article onwards. Any ideas?

Also just thought I'd add that I'm really impressed with Treehouse as a whole, and it's really helped me pick up tonnes of new skills in a pretty small space of time. The new layout is great too, thanks.

<div id="slider" class="grid_12">
            <div class="wmuSlider">
                <div class="wmuSliderWrapper">
                    <article>
                        <img width="100%" src="img/slider1.jpg" />
                    </article>
                    <article>
                        <img width="100%" src="img/slider2.jpg" />
                    </article>
                    <article>
                        <img width="100%" src="img/slider1.jpg" />
                    </article>
                    <article>
                        <img width="100%" src="img/slider2.jpg" />
                    </article>
                </div>
            </div>
        </div>
#slider {
    margin: 30px auto 5px auto;
    border-bottom: solid 5px rgba(29, 255, 54, 0.6);
    max-height: 50%;
    min-height: 50%;
    position: relative;
}

.wmuSlider {
    min-height: 100%;
}

.wmuSliderWrapper {
    max-height: 100%;
    min-height: 100%;
}

.wmuSliderWrapper img {
    display: block;
    margin: 0 auto;
    border-radius: 20px;
    max-width: 80%;
    max-height: 100%;
    box-shadow: 0px 0px 20px rgba(95,95,95,.4);
}

article {
    min-height: 70%;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
}

.wmuSliderPagination {
    z-index: 2;
    position: absolute;
    left: 40%;
    bottom: 2%;
}
.wmuSliderPagination li {
    float: left;
    margin: 0 5px 0 0;
    list-style-type: none;
}

.wmuSliderPagination a {
    display: block;
    text-indent: -9999px;
    width: 10px;
    height: 10px;
    background-color: rgba(171,3,204,0.6);
    margin: 10px;
    border-radius: 10px;
}

.wmuSliderPagination a.wmuActive {
    background-color: rgba(171,3,204,1);
}

3 Answers

This will be easier to debug if you put it into a codepen.io and post that saved link back here, so than we can all play around with it and see instant results.

Hey, thanks for the quick response. I've put it all up on CodePen but the jQuery wmuSlider doesn't seem to be doing anything, despite it working locally...

http://codepen.io/anon/pen/kaGdB

I've replaced my actual images with a random image off Google as mine aren't hosted anywhere online. Should the slider be working on there? It's exactly what I've got on my pc...

Edit: I've realised the only difference is I haven't put my linked jQuery sheet up there... is that necessary? It seems like a huge amount of code to paste onto CodePen.

jQuery is neccessary, but on codepen under the JS, click on the gear icon. It'll open a popup, which will allow you to select a libary. In that list, you can choose jQuery, and codepen will link in jquery on it's own. Easy peasy. You can do that and save it.

Hey, I have now selected jQuery (thanks for the tip) and nothing appears to have changed. The animation still isn't happening and the Javascript just isn't running. Sorry about this... but any further ideas on this new issue?