PDA

View Full Version : fitvids.js


grantfulcher
04-10-2014, 02:13 PM
I am novice. I tried to use fitvids to make a youtube video responsive (it will scale based on the browser). I couldn't get it to scale/resize.

Placed inside the <head>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>

<script src=jquery.fitvids.js></script>

<script>$(document).ready(function(){

$("#thing-with-videos").fitVids();

});


</script>

My HTML file
<div id="thing-with-videos">
<iframe width="560" height="315" src="http://www.youtube.com/embed/SZjqXdSMaTA" frameborder="0" allowfullscreen> </iframe>
</div>

My CSS file
nothing

gentleone
04-10-2014, 03:05 PM
You sure everything is in the right folder? You load jQuery from 'js' folder but fitvids.js not, so there is a difference in paths.
Can you put it online somewhere?

grantfulcher
04-10-2014, 03:37 PM
I placed all the files in the same folder and followed a tutorial found in the web. Was a bit too ambitious. but here is the folder with everything from sendspace in a zip file.

http://www.sendspace.com/file/vvdwlq

Did not change any code (cut and pasted everything) except added the "id=thing-with-videos" in my div class if I understood that tutorial correctly. Anyway thanks in advance.

grantfulcher
04-10-2014, 05:31 PM
Sorry about that. Forget the html page in the zip file. Corrected file here:

http://www.sendspace.com/file/n8f72b

gentleone
04-10-2014, 06:02 PM
The zip was not much of use since you only putted jquery and fitivids.js in it. I also need the HTML page.
But anyway... looking at your code here above more thoroughly, I see you miss some double quotes.

You have:

<script src=jquery.fitvids.js></script>

Which should be:

<script src="jquery.fitvids.js"></script>

grantfulcher
04-10-2014, 06:10 PM
Holy Smoke. Thank you very much. THAT WORKED.

I did send you a new zip file . But don't mind it. You FIXED it.

gentleone
04-10-2014, 06:19 PM
Yeah, I saw your second message after I posted.

Try to keep things organized already from the start. If you have js files create a 'js' folder in the root and put them in there. If you have external CSS files create a 'css' folder for them.