简体   繁体   English

如何将最大宽度设置为javascript弹出窗口

[英]how to set max width to javascript pop-up

The html code below results in a link which says "sacola the compras" 下面的html代码导致一个链接,其中显示“ sacola the compras”

<div> 
<script type="text/javascript" src="https://app.ecwid.com/script.js?4549118"></script> 
<script type="text/javascript">
xMinicart("style=","layout=Mini"); 
</script> 
</div>

If you click the link, a pop-up window appear (it's not a pop-up per say, as it appears in the original window). 如果单击链接,则会出现一个弹出窗口(不是说出来的弹出窗口,因为它出现在原始窗口中)。 My problem with the pop-up is that it is not responsive. 我的弹出窗口问题是它没有响应。 If I use an iPad or iPhone, the pop-up window will exceed the screen size. 如果使用iPad或iPhone,则弹出窗口将超过屏幕尺寸。

For you to check the problem, please enter this website and click in visitor access . 为了您检查问题,请进入该网站并单击visitor access Then click in the link which says "sacola de compras" 然后点击显示“ sacola de compras”的链接

How do I limit the pop-up width? 如何限制弹出窗口的宽度? Does it have to do with the xMinicart function above? 与上面的xMinicart函数有关吗?

Not sure if it helps, but here is the javascript from the code above 不确定是否有帮助,但这是上面代码中的javascript

Thanks in advance 提前致谢

Use max-width 使用max-width

Either in your CSS 在您的CSS中

.ecwid-popup {
    max-width: 200px;
}

Or inline, in your HTML 或内联,在您的HTML中

<div class="ecwid-popup ecwid-ProductBrowserPopup ecwid" style="max-width: 200px;">

Ecwid will eventually make that popup-like window responsive so that it will work fine on any device. Ecwid最终将使该弹出式窗口响应,以便在任何设备上都能正常工作。 Meanwhile, I can suggest a workaround: although it does not make the popup responsive, it will allow you to avoid popup and display the cart contents on a separate responsive page that will look fine on mobile devices. 同时,我可以建议一种解决方法:尽管它不能使弹出窗口响应,但它可以避免弹出窗口,并在单独的响应页面上显示购物车内容,该页面在移动设备上看起来很好。 The workaround is using Ecwid's ecwid_ProductBrowserURL option like this: 解决方法是使用ecwid_ProductBrowserURLecwid_ProductBrowserURL选项,如下所示:

 <script> var ecwid_ProductBrowserURL = "http://www.example.com/my_separate_store_page.html"; </script>

With this option used, a visitor who clicks the minicart icon, will be automatically redirected to a responsive cart page. 使用此选项,单击微型购物车图标的访客将被自动重定向到响应式购物车页面。 Find the details on how to implement it here: http://kb.ecwid.com/w/page/15853260/ecwid_ProductBrowserURL 在此处找到有关实施方法的详细信息: http : //kb.ecwid.com/w/page/15853260/ecwid_ProductBrowserURL

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

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