iFrame embed widget settings

  • Profile Image
    AgilityAssoc.Canada
    Asked on May 26, 2017 at 06: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);
              }
            });
          });

     

  • Profile Image
    Mike_G
    Answered on May 26, 2017 at 06:58 PM

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

    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.

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

    Thank you.

  • Profile Image
    AgilityAssoc.Canada
    Answered on May 28, 2017 at 09:10 AM

    Hi,

    Thank you for the clarification. Good to know. 

    Regards Robert