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 trialWayne Priestley
19,579 PointsUsing the unique ID defined within the fitvid script
Using the unique ID defined within the fitvid script, add the appropriate code to the div that contains the embedded video so it scales with the fluid layout.
Thats the question, here is my code.
<div class="container">
<div class="grid_6 omega">
<div id="#featured-video">
<iframe src="http://player.vimeo.com/video/50610288? title=0&byline=0&portrait=0" width="400" height="225"frameborder="0"></iframe>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"> </script>
<script src="jquery.fitvids.js"></script>
<script>
$(document).ready(function(){
$("#featured-video").fitVids();
});
</script>
Where i have set the div id, I've tried with and without # I've searched through lots of posts that have asked this question but none have given any sort of answer.
help appreciated please
6 Answers
James Barnett
39,199 PointsHint #2
I'm a div with a class
<div class="apples"></div>
I'm a div with an id
<div id="bananas"></div>
I'm a div with a class and an id
<div class="apples" id="bananas"></div>
James Barnett
39,199 PointsHere's a hint, sometimes you don't need an extra div, just add the id to the existing div.
Wayne Priestley
19,579 PointsI'd tried this earlier without success.
<div class="container">
<div class="grid_6 omega featured-video">
and
<div class="container">
<div class="grid_6 omega #featured-video">
and
<div class="container featured-video">
<div class="grid_6 omega">
and
<div class="container #featured-video">
<div class="grid_6 omega">
James I have a feeling I'm gonna need a bigger hint, lol
Steve Leichman
7,008 PointsJesus Christ, James. Thank you. This was absolutely killing me. Then I have a question: What's "wrong" with the way that Wayne initially did this? I was doing this the same way and I don't really see the problem. Is it just a case of DRY?
Steve Leichman
7,008 PointsJesus Christ, James. Thank you. This was absolutely killing me. Then I have a question: What's "wrong" with the way that Wayne initially did this? I was doing this the same way and I don't really see the problem. Is it just a case of DRY?
jerrrodgunning
1,149 Points<div class="grid_6 omega" id="featured-video">
Wayne Priestley
19,579 PointsWayne Priestley
19,579 PointsCheers James, your a star