Bootstrap Popover-关闭保存HTML [英] Bootstrap Popover - Save HTML on close

查看:122
本文介绍了Bootstrap Popover-关闭保存HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个订购页面,您可以在其中选择所需的产品类型.对于特定产品,它们有一个称为规格"的东西.当有一个按钮时,就意味着有规格.如果单击它,则会出现一个带有复选框列表的弹出窗口.一切正常,没有问题.

I have an order page where you select what type of products you want. For specific products, they have something call "specifications". When there's a button, it mean that there's specifications. If you click on it, a popover appear with a list of checkbox. This is working fine and without problem.

现在的问题是,当我再次单击时,弹出窗口关闭(也可以),但是数据无法保存.我认为它会从内容中复制并缓存它.

Now the problem I have is, when I click back again, the popover close (also ok) but the data doesn't save. I assume it does a copy from the content and cache it.

我的问题是,有没有一种方法可以关闭数据或在弹出窗口中使用DIV中的实时"数据?

My question, is there a way to save the data when it close or use "live" data from a DIV within the popover ?

谢谢.

您要在设备列表中找到什么:

What you want in the equipment list:

<div id="specs-1" class="hide">
    <ul class="specs-group unstyled">
        <li>...</li>
    </ul>
</div>
<a href="#" rel="popover" data-original-title="Specifications" data-placement="top">S</a>

DIV的内容在POPOVER中.现在,当contnet更改时,我希望它反映在DIV中.

The content of the DIV goes in the POPOVER. Now, when the contnet change, I want it to reflect in the DIV.

谢谢.

推荐答案

您必须管理按钮的关闭事件.似乎Twitter的启动弹出窗口上没有回调,因此您必须手动执行.

You have to manage close event of the button. It seems there is not a callback on twitter's bootstrap popover so you have to do it manually.

如果您完全控制弹出窗口上显示的内容,则应为元素分配一种标识它们的方法(例如,一个ID),然后将元素绑定到javascript函数.使用该功能,您可以将内容从弹出窗口复制到div.

If you have full control of content displayed on popover you should assign to elements a way to identify them, an id for example, then bind elements to a javascript function. With the function you can copy content from popover to the div.

这篇关于Bootstrap Popover-关闭保存HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆