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
troy beckett
12,035 PointsHelp on making an image gallery???
Have a look at this website below:
http://www.sandrageringinc.com/artists/todd-james/#/images/14/
I'm not looking to use the exact sytling but whats needed to achieve this way of displaying images.
I would like to make a similar display where you I can hover over smaller images, that when rolled over makes a bigger image next to it.
Any advice on what that will take and where to look to begin trying to learn how to make it would be brilliant
thanks in advance guys.
1 Answer
rydavim
18,814 PointsYou'll need some CSS to make it look nice, and some JavaScript to get the hover effect you're looking for.
The JQuery library for JavaScript would likely make this type of hover effect pretty straight-forward.
The Lightbox section of the JQuery Basics course isn't the same effect, but I think it teaches concepts that would be useful to this project.
EDIT - Going to go try this out now to make sure it's as I'm imagining.
EDIT #2 - Here is a quick and dirty version of what I'm imagining you mean.
troy beckett
12,035 Pointstroy beckett
12,035 PointsHey thats pretty much what I was looking to achieve to start then build it up as I go along, really great how you did it so quick. Like you said I know the basics of javascript and jquery but I'm just struggling at the moment with how to start things.
any advice on what you did here looks great...
rydavim
18,814 Pointsrydavim
18,814 PointsThe JS right now is actually really short and simple. There are definitely features you could add, like you said.
There are definitely features you could add to make it nicer than this. But you're absolutely right that it's a good plan to start from the most basic concept and build up slowly.
I find it's easiest to think of it in blocks, and I tend to start with the event personally.
For this, I know I need to do something when I mouseover the thumbnails, so I start with that.
How do I select those thumbnail images?
How do I do that when I mouseover them?
For me, it's easier to do that and then figure out what I want to do once I've got that $(this) to work with. But I'm sure there are as many approaches as there are people who write code. I am still fairly new to this, so I refer to the documentation on the JQuery site a ton.
EDIT - I also save all of my Treehouse projects.
When I'm learning a new language, I like to refer to previous projects when I'm working on new stuff. Much of the time, there are similar enough things in previous work that you can reuse parts of them or concepts in new projects.
For this, I referred to the Lightbox project that @chalkers teaches in the JQuery course. It's not the same goal, but the structure helped me knock out a basic plan quickly.
troy beckett
12,035 Pointstroy beckett
12,035 Pointscool that's some good advice, I'm pretty decent at css now so I'm trying to push on with javascript and jquery. I guess I'm at that stage where I just need to keep pushing on watching news videos trying projects and I'll start picking it up. But your right with treehouse I need to make more of an effort of saving there projects as a lot of what they teach can be changed slightly and used differently.
Thanks again you've gave me a great starting point for me to push on with my project
Robert Richey
Courses Plus Student 16,352 PointsRobert Richey
Courses Plus Student 16,352 PointsHere's a Codepen I put together that may give you some ideas - specifically the JavaScript logic on hiding and displaying images. This took some time for me to reason about, and eventually it seemed easier to just hide all images and then show the one you want.