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

CSS

Could someone check my css declarations for my header that involves vw units? (codepen included).

I made this site with a image that should re-size with the browser window. I used vw units to make this possible, and the css for the header starts on line 227-234. This is a mobile first site, so I didn't add media queries for desktop yet. Thanks in advance for any help.

Codepen http://codepen.io/mike316/full/yNWovK/

2 Answers

Hi Mr. X.

Checked your Pen and it looks OK.

Just an advice: you added your jQuery plugin after you linked the jQuery dependencies in a <script> code, code, code </script> right after the jQuery.

Would be better if you add it at the end of your HTML file, right before the closing body tag. -> just to make sure that the page is fully loaded before the plugin is called upon to make the magic.

Or you could also have a separate .js file where all your plugins would be called out from. ( and use $(document).ready(); ) so that the whole page is loaded.

It's just best practice: your solution works but could give you some headaches in the future with future code.

Have fun coding and make sure to check Dave McFarland 's jQuery plugins course and CSS course with Guil Hernandez to get more thorough info.

Regards,

nWEBd

Thanks Nejc for your help. For the jQuery I used the demo that came along with the plugin, and you're right I should have added before the closing tag to make sure that the page is fully loaded. I do have one question, can you point me to the video that shows how to use a separate js file where all my plugins could be called? I can't seem to find examples of how to this, and I'm very interested in learning this neat trick. Thank you.

Hey no problem.

Here's the link to Dave's jQuery Plugin course: http://teamtreehouse.com/library/using-jquery-plugins

He covers all the info you will need when choosing plugins: what to look for, how to implement them into your site and much much more.

Best way to learn about this is Treehouse ;)

SWEET!!!! Thank you so much Nejc, I really appreciate it.

Your welcome Mr. X.

Happy coding.

And don't forget: if you have a question -> don't be too shy to ask.