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
Joseph Frazer
5,404 PointsSmoother control with background
I'm currently making a site with a background moving when the mouse moves anywhere on the body. it works but when the mouse stops moving I was it to move just a little more. If you don't' know what I mean this site is an example. At the Patreon section with images of birds, when you move your mouse it has more of a transition when you stop moving the mouse. Example Site: http://kurzgesagt.org My code: https://codepen.io/frazer380/pen/rzOwMe
2 Answers
martinjones1
Front End Web Development Techdegree Graduate 44,824 PointsHi,
You good try adding a CSS transition to the .newsletter class like:
.newsletter {
transition: .35s ease-out;
}
You would likely need to play around with this a bit more to get something a bit smoother.
Or if you prefer, the JS being used on the website you mentioned can be found at:
https://github.com/Mao39/mao39.github.io/blob/master/js/jquery.parallax.min.js
martinjones1
Front End Web Development Techdegree Graduate 44,824 PointsHe appears to be using the class ".layer" as the hook for the JS file.
You could try including the JS file and using a similar structure to the HTML markup and classes on the website to see if you can replicate it, you might get a bit closer that way to either making that JS file work right away or at least get a better understanding of how he has achieved it in the JS file.
Chrome Dev Tools will help a lot here if you want to explore it further
Joseph Frazer
5,404 PointsJoseph Frazer
5,404 PointsHow would I use that JS?