Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting proposal: padding-top #150

Closed
leoj3n opened this issue Dec 29, 2013 · 4 comments
Closed

Setting proposal: padding-top #150

leoj3n opened this issue Dec 29, 2013 · 4 comments

Comments

@leoj3n
Copy link

leoj3n commented Dec 29, 2013

Thesis

Based on my findings in this comment, specification of padding-top percentages per fitVid() instance should be allowed.

Discussion

  1. Should this be implemented as an additional setting?
  2. Or should this be done externally as a forceful override using either CSS or JS?
@davatron5000
Copy link
Owner

I'm not sure I understand what you need? Are you trying to set a maximum height or aspect ratio? If you're doing this by hand, you could just fudge the height/width attributes to get calculate the percentage you want:

var aspectRatio = (height / width) * 100 + '%';

@leoj3n
Copy link
Author

leoj3n commented Feb 28, 2014

For Vimeo videos, the only embeds I've used with FitVids, I've consistently found setting padding-top to exactly 56% eliminates vertical black bars that otherwise appear on the left and right inside the iframe. So I guess I'm essentially setting the aspect aspect ratio? I haven't toyed with it in a while but if I remember correctly I don't think setting the aspect ratio in JS solved the problem.

@davatron5000
Copy link
Owner

@leoj3n Could you check with #152, are these the black bars you're seeing?

@chapeladmin
Copy link

This is not the same as #152 unless the rounding errors can be greater than 10s of pixels. From #152 it seems more like off by a pixel in the case of odd division by 2 rounding issues. I can confirm setting padding-top to 56% eliminates all the issues for vimeo. To get around this, I just have a vimeo-specific wrapper and use css and !important to override the element style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants