iFrame embed widget settings

  • AgilityAssoc.Canada
    Asked on May 26, 2017 at 6:36 PM

    iFrame embed widget settings

    When I was working on it yesterday I used console and found some JavaScript in a html file that sets width and height of the iframe. I was trying to set my own width and height in the iframe with custom css, So which has the priority? Would using !IMPORTANT over ride the java script?

    widgets.jotform.io

     
        (function(ready) {
          ready(function() {
            JFCustomWidget.subscribe("ready", function(data) {
              var params = JFCustomWidget.getWidgetSettings();
              if (params.url) {
                var transparent = ('transparent' in params && params.transparent === 'Yes') ? 'true' : 'false';
                var iframe = document.createElement('iframe');
                iframe.setAttribute('src', params.url);
                iframe.setAttribute('allowtransparency', transparent);
                iframe.setAttribute('frameborder', '0');
                iframe.style.border = 'none';
                iframe.style.margin = 0;
                iframe.style.width = (data.viewWidth || 560) + 'px';
                iframe.style.height = (data.viewHeight || 400) + 'px';
                document.body.appendChild(iframe);
              }
            });
          });

     

  • Mike_G JotForm Support
    Replied on May 26, 2017 at 6:58 PM

    I see that you are referring to this (please see image below)

    iFrame embed widget settings Image 1 Screenshot 30

    That is the default widget's settings which can be overridden by custom CSS injected in the form and would require the help of !important declaration.

    iFrame embed widget settings Image 2 Screenshot 41

    If you have any further questions regarding this, please feel free to contact us again anytime.

    Thank you.

  • AgilityAssoc.Canada
    Replied on May 28, 2017 at 9:10 AM

    Hi,

    Thank you for the clarification. Good to know. 

    Regards Robert