简体   繁体   English

如何在中预览移动网站 <iframe> 在引导模式下站点的桌面版本中

[英]How to preview mobile site in <iframe> in desktop version of site in bootstrap modal

I want to show mobile version of website in desktop version . 我想在桌面版本中显示网站的移动版本。 Basically we have 2 website m.xyz.com and xyz.com , now what i want is to show m.xyz.com in desktop on click of preview . 基本上我们有2个网站m.xyz.com和xyz.com,现在我想要的是在单击预览时在桌面上显示m.xyz.com。

<script>
$('#preview_feature').click(function() {

            $('.faqModal').on('shown.bs.modal',function(){     

              $(this).find('iframe').attr('src','https://m.xyz.com/abc')
            })
              $('.faqModal').modal({show:true})
            })
    </script>

    //On click of this button i am showing model which will preview mobile version of website 
    <button type="button" id="preview_feature" class="btn btn-info btn-lg btn"  >Preview Feature</button>

    <!-- Modal -->
      <div class="modal fade faqModal" id="faqModal" role="dialog">
        <div class="modal-dialog">
          <!-- Modal content-->
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal">&times;</button>
              <h4 class="modal-title">Preview</h4>
            </div>
            <div class="modal-body">
              <iframe style="width:940px;height:560px;-webkit-transform:scale(1);-moz-transform-scale(1);"></iframe>
              </iframe>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
          </div>  
        </div>
      </div>

See this is working for me: 看到这对我有用:

<!DOCTYPE html>
<html>
    <body>
        <iframe src="https://en.m.wikipedia.org/wiki/Main_Page" width="400px" height="500px">
        </iframe>
    </body>
</html>

Please try decreasing the width so that if it using proper js for mobile platform redirection then it will be working fine. 请尝试减小宽度,以便如果它使用正确的js进行移动平台重定向,那么它将正常工作。

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

相关问题 如何通过移动版本向网站的桌面版本发出 AJAX 请求 - How to make a AJAX request to a Desktop version of a site via the Mobile version 如何在移动网站上创建“桌面版本”链接而不将其重定向到移动网站 - How to create a “Desktop Version” link on mobile website without it redirecting to the mobile site 如何在移动网站上创建“查看桌面版本”链接,而在解析后又不会循环回到移动版本? - How can I create a “view to desktop version” link on mobile site without it looping back to mobile version when it resolves? 从移动网站重定向到桌面网站 - Redirect from mobile site to desktop site Bootstrap模式在站点中无法正确显示 - Bootstrap modal not showing properly in site 从移动设备(wordpress)重定向后,如何留在桌面版网站上 - How to stay on Desktop site when redirected from mobile (wordpress) 如何检测 iOS Mobile Safari 和 Chrome 的“请求桌面站点”模式? - How to detect “request desktop site” mode of iOS Mobile Safari and Chrome? 如何检测网站是否加载到移动设备上的iframe中? - How to detect if the site is loaded inside an iframe on a mobile device? Bootstrap网站在移动设备上没有响应 - Bootstrap site not being responsive on mobile 将现有网站转换为移动版本 - Converting Existing site into Mobile Version
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM