2015-07-28 127 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

相關問題