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

JavaScript

Kris Byrum
Kris Byrum
32,636 Points

Video fitVid Not working.

I'm attempting to use the fitVid jQuery on my website that i'm building, but for some reason it still does not work.

This is the portion in my html that the code is in. There are two other videos above this one.

I've followed the direction in the fitvid as well as the responsive webdesign lesson, but it is not working.

Please let me know if there is something I'm missing or what may be the issue.

Thanks in advance!!

            <div id="video_container">
                <p class="video-description">Sally Showman - Reporting Reel</p>
                <iframe src="http://player.vimeo.com/video/93069390" width="400" height="203" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen
                id="video"></iframe> 
            </div>
        </section>
    </div>
    <script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/jquery.fitvids.js"></script>
    <script>
      $(document).ready(function(){
        // Target your .container, .wrapper, .post, etc.
        $("#video_container").fitVids();
      });
    </script>

2 Answers

Kris Byrum
Kris Byrum
32,636 Points

I figured it out. I guess that you have to wrap EACH div with the class name and not just the entire vid div.

Are you getting any errors in your JS console? (Ctrl+Shift+J or Cmd+Alt+J on Mac)