2015-07-28 124 views
1

我有一个链接,我想打开模式弹出。我使用的引导3.Bootstrap模式弹出不打开链接上弹出点击

这是我的代码:

<a id="auto-topup2" href="#" data-target="#auto-topup" > 
    <i class="fa fa-clock-o fa-lg "></i> 
    <?php echo __('Schedule AutoVend', $my_account_info['customerGroup']) ?> 
</a> 

我挂像这样:

<div class="modal fade" id="auto-topup" tabindex="-1" role="dialog aria-labelledby="auto-topup" aria-hidden="true"> 
    <div class="container"> 
     <!-- Container Code --> 
    </div> 
</div> 

但它不是打开弹出,什么是错?

回答

1

您需要将数据切换属性添加到您的链接

data-toggle="modal" 

,然后设置您的href属性的id的模态

href="#auto-topup" 

所以,你应该有这样的事情

<a id="auto-topup2" data-toggle="modal" href="#auto-topup" > 
    <i class="fa fa-clock-o fa-lg "></i> 
    <?php echo __('Schedule AutoVend', $my_account_info['customerGroup']) ?> 
</a> 
+0

不需要'data-target'? – Geetika

+0

不,引导程序将使用href作为您的数据目标 – user65439

+0

太棒了,它的工作。 thanx :) – Geetika

相关问题