使用Orderahead允許爲我的客戶端在線訂購簡單的一個網頁網站,我一直在試圖弄清楚如何動態更改iframe的寬度,以便它可以在像iPhones這樣的小屏幕上正確觀看。我已經嘗試了許多想法,但可能我做錯了,希望這裏的某個人可以幫助解決問題。該網站和它的HTML可以在這裏查看:www.vngrill.com如何動態更改iframe的寬度以適當地適合
這裏是JS我需要包括在我的頭標記。
<script type="text/javascript" src="//asset-hosting.s3.amazonaws.com/2-156/jquery.min.js"></script>
<script type="text/javascript" src="//pixel-track.s3.amazonaws.com/2-156/pixel.min.js"></script>
<script type="text/javascript" src="//scripts.seo-optimizer.net/1/seo.min.js"></script>
反過來,將以下內容加載到頁面中。
<iframe id="vn_grill_oo" width="100%" height="50px" frameborder="0" scrolling="no" allowtransparency="true" seamless="seamless" src="http://badges.orderaheadapp.com/html/widget.html?widgetStyleHeight=50px&widgetStyleType=oa-full&widgetStylePosition=oa-top&widgetClassStyles=oa-dark%20oa-top%20oa-full&businessName=VN%20Grill&businessid=1413" style="position: fixed; left: 0px; z-index: 9999; top: 0px;"></iframe>
I幀的高度和寬度可以-不百分比的設置.... [參考文獻](HTTP:/ /www.w3schools.com/html/html_iframe.asp) – Bhavik