Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Can you add the possibility to put width in % or another unit instead of only px for frame sizes ?
px are not funny to style...
Thanks a lot :)
Comment | File | Size | Author |
---|---|---|---|
#10 | iframe-width_of_frame-2822197-10.patch | 1.71 KB | frederickjh |
#8 | Selection_331.png | 16.92 KB | frederickjh |
Comments
Comment #2
mukeshMukesh12 CreditAttribution: mukeshMukesh12 at gai Technologies Pvt Ltd commentedIt is possible to make Embeded Iframes responsive.(give width to iframes in % with css)
please refer this link:- http://embedresponsively.com/ (See result click on Embed button).
but in many modules the Iframe Structure is not like embed iframes i.e youtube,vimeo.
in modules iframe structure inside body tags there are only divs where as in embed iframes there is object tag which allow the css to over-ride iframe css (allow to set width in % with css)
Some how if we introduce this object tag in modules iframes then it become easy to set there width in % with css.
Comment #3
neffets CreditAttribution: neffets commentedI experimented with "object" tag too, but there were IE issues
see static page: http://www.neffets.de/sites/static/object4iframe.html
Feedback welcome.
In newer browsers there were issues relating object-with-url-from-foreign-site security-violation warnings/errors.
Comment #4
mukeshMukesh12 CreditAttribution: mukeshMukesh12 at gai Technologies Pvt Ltd commented@neffets Sorry I'dont have IE7 and IE8 browser in my system and recommended please not to give priority to these browsers as they are outdated.
as I go through this link http://www.neffets.de/sites/static/object4iframe.html. the iframes are not looking so good.
please try this
first of all wrap each object tag into a wrapper say object-wrapper.
and link this style to this
.object-wrapper {
width: 100%;
height: auto;
position: relative;
padding-bottom: 56.25%;
}
.object-wrapper object {
width: 100% !important;
height: 100% !important;
position: absolute !important;
top: 0 !important;
left: 0 !important;
}
I think surely this will work please try
Comment #5
neffets CreditAttribution: neffets commentedobject-wrapper added:
Variant A: without bottom padding, height auto seems to be calculated to 0
Variant B: padding-bottom 56%
is here to much, its not dynamic, its fix from window of parent-page, not of the object-iframe
Comment #6
osopolarMaybe the FitVids module could be helpful for this issue.
Comment #7
neffets CreditAttribution: neffets commentedVersion 8.1.6 supports heigth/width with "%" values
tec: #^(\d+|\d+[%]|auto)$#
Comment #8
frederickjh@neffets
Changing this to a Documentation task and bumping the version as the feature now exists but the documentation and UI still refer to the fixed numbers.
From 8.x-1.7 README.txt
User interface:
Comment #9
frederickjhThe use of percentages is documented on the project page.
Comment #10
frederickjhPatch updating the README.txt and the UI.
Comment #11
osopolarThe use of percentage for width was introduced in #2748283: Width and Height fields are required all the time. Would be nice if back-ported to drupal 7.
Comment #13
neffets CreditAttribution: neffets commentedAdded documentation.