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
Pedro Diaz
3,293 Pointsis it possible to add a jquery or javascript image slider using the cosde from the "Howto build a website" lesson?
Hello, i just finished the How to build a website course and i loved it! Nick is awesome and clear. i know the finished "Portfolio" website looks amazing and well i starte to customize it and i want to add an image slider. i want to know if i can keep all the properties and little tricks on css and also add a slider... or would i need to modify anything on css to make the gallery work if i apply j query, javascript or even better plaint css with using keyframes???
4 Answers
Craig Watson
27,930 PointsHi Pedro,
Yes, to make a slider from the code used to make the gallery on the "how to make a website" course you would need to modify it quite a bit. The problem with the code is that it has been set up for a specific layout. Most sliders come with specific markup, they are done this way as there JavaScript is set up to run with it. That said there is nothing preventing you from modifying things to suit the slider.
Truthfully, you are most likely looking at removing all HTML and CSS that make the current static gallery and then adding in the needed HTML and CSS from your chosen slider.
Hope this helps Craig :)
Craig Watson
27,930 PointsHi Pedro,
If you want to add a slider like Slick to your site, they come with CSS to handle their own styles. However, you can customize them and build on them to better suit your needs.
My advice would be to make a folk of your workspace (or project if it is not on workspaces) and dive into the code, you will have great fun adding Sick your site. The reason for the folk is so you don't loose all the previous hard work.
Craig
Pedro Diaz
3,293 Pointsthanks for the response Craig, well I was using unslider and now I'm using jut plain CSS with keyframes. i just want to know if with the code from "how to make a website", lesson here at treehouse, can still apply the new CSS, jquery or plain javascript code? or will I need to modify all the CSS from the lesson to accommodate the slider or if it would work having it like it is. example:
:#gallery {
margin: 0;
padding: 0;
list-style: none;
}
#gallery li {
float: left;
width: 45%;
margin: 2.5%;
background-color: #f5f5f5;
color: #bdc3c7;
}
#gallery li a p {
margin: 0;
padding: 5%;
font-size: 0.75em;
color: #bdc3c7;
}
what if i had that still, but wanted to add keyframes to make the slide.
Pedro Diaz
3,293 PointsHey Craig. you have no idea how much i appreciate this answer! i need sometimes very specific 2 year old explanations and u told me exactly what i needed to know. The thing with the code is that it is so damn cool that i feel like i wanna use different versions of it till i die hehehe im a newbie probably 4 months and i've been doing a lot of freelance just to learn and since there are soooo many ways to sort of accomplish the same thing, a person like me tends to overthink way to much... anyway thanks a lot bro:)