简体   繁体   English

使此联系表单使用Javascript响应

[英]Making this contact form responsive with Javascript

I'm very new to javascript but in mid-level with HTML and CSS. 我对javascript很陌生,但是在HTML和CSS的中级水平。

So here is the issue. 这就是问题所在。 I just registered a third party contact form service with Foxyform. 我刚刚在Foxyform注册了第三方联系表服务。 They provided a code to paste in the page and upload it. 他们提供了代码以粘贴到页面中并上传。 It works fine in desktop views, however when one visits the contact page on different mobile or smaller devices it looks out of space and non-responsive. 它在桌面视图中可以正常工作,但是当人们在不同的移动设备或较小的设备上访问联系人页面时,它看起来空间不足且无响应。 There is no option to edit it in @media screen within the theme. 没有选项可以在主题的@media屏幕中进行编辑。

Is it possible to make this contact form responsive? 是否可以使此联系表具有响应性?

Here are the codes: 以下是代码:

HTML: HTML:

<a id="foxyform_embed_link_602624" href="http://www.foxyform.com/"></a>

Javascript: 使用Javascript:

(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = "http://www.foxyform.com/js.php?id=602624&sec_hash=54f3ab77bfb&width=350px";
s.parentNode.insertBefore(g, s);
}(document, "script"));

Your contactform provider includes an iframe in your page. 您的contactform提供商在页面中包含一个iframe

An iframe can not be styled by the website on which is it included as most browser handle it as an own webpage which is embedded in another webpage. 包含iframe的网站无法设置iframe的样式,因为大多数浏览器都将其作为自己的网页嵌入到另一个网页中。

Found a fix with CSS (not jquery/javascript sorry) ( for googleCalendar iframe ) but I used the same concept for foxyForms iframe. 找到了CSS修复程序(不是jquery / javascript对不起)(适用于googleCalendar iframe),但我对foxyForms iframe使用了相同的概念。

via https://thomas.vanhoutte.be/miniblog/make-google-calendar-iframe-responsive/ 通过https://thomas.vanhoutte.be/miniblog/make-google-calendar-iframe-sensitive/

html HTML

    <div class="responsiveCal">

      <iframe src="https://calendar.google.com/calendar/embed? showTitle=0&amp;showDate=0&amp;showPrint=0&amp;showCalendars=0&amp;showTz=0&amp;height=600&amp;wkst=2&amp;hl=nl&amp;bgcolor=%23FFFFFF&amp;src=example.be_cpkbjcpttgb5q0%40group.calendar.google.com&amp;color=%23ffcf03&amp;ctz=Europe%2FBrussels" style="border-width:0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
    </div>

css CSS

    .responsiveCal {

      position: relative; padding-bottom: 75%; height: 0; overflow: hidden;

    }

    .responsiveCal iframe {

      position: absolute; top:0; left: 0; width: 100%; height: 100%;

    }

It allowed me to place a row within the container as well to use bootstraps responsive classes. 它允许我在容器内放置一行,并使用引导响应类。 Hope this is right, I'm still a beginner please feel free to correct any mistakes I made.. 希望这是对的,我仍然是初学者,请随时纠正我犯的任何错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM