logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > Javascript and JS frameworks
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 04-10-2014, 03:13 PM   #1
grantfulcher
 
Join Date: Apr 2014
Posts: 5
Default fitvids.js

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
grantfulcher is offline   Reply With Quote
Old 04-10-2014, 04:05 PM   #2
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

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?
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 04-10-2014, 04:37 PM   #3
grantfulcher
 
Join Date: Apr 2014
Posts: 5
Default

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 is offline   Reply With Quote
Old 04-10-2014, 06:31 PM   #4
grantfulcher
 
Join Date: Apr 2014
Posts: 5
Default

Sorry about that. Forget the html page in the zip file. Corrected file here:

http://www.sendspace.com/file/n8f72b
grantfulcher is offline   Reply With Quote
Old 04-10-2014, 07:02 PM   #5
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

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:
HTML Code:
<script src=jquery.fitvids.js></script>
Which should be:
HTML Code:
<script src="jquery.fitvids.js"></script>
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 04-10-2014, 07:10 PM   #6
grantfulcher
 
Join Date: Apr 2014
Posts: 5
Default

Holy Smoke. Thank you very much. THAT WORKED.

I did send you a new zip file . But don't mind it. You FIXED it.
grantfulcher is offline   Reply With Quote
Old 04-10-2014, 07:19 PM   #7
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

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.
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:33 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com