Resizes all iframes

Created on 8 November 2015, over 9 years ago
Updated 21 July 2025, 10 days ago

The JavaScript component (field_slideshow.js) of the module contains a method (resize_videos) that currently resizes all iframes, objects and embeds on the page whenever it is called. 'style="width: 0px"' gets attached to the iframe/object/embed, making it effectively invisible.

We encountered this when using a youtube embed (iframe) on a page with a slideshow field display. The youtube embed and slideshow field were not directly connected, just output on the same page.

The problematic code, and a suggested fix are below.

      var resize_videos = function(context, max_width) {
        $("iframe, object, embed").each(function() {
      var resize_videos = function(context, max_width) {
        context.find("iframe, object, embed").each(function() {
🐛 Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom Jeff.Parker

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024