2013-10-23 29 views
0

我在網站上使用基礎揭示爲模態,但是當我點擊模態發射鏈接時,它不會將其視爲模態,只能看到錨點「#」 。該網站是dev.birddartmouth.co.uk基礎揭示不識別模態鏈接

這裏是我的輸出模式HTML:

<a href="#" class="item" data-reveal-id="292"> 
    <img src="http://dev.birddartmouth.co.uk/wp-content/uploads/2013/10/096.jpg"> 
</a> 

<div id="292" class="reveal-modal"> 
    <i class="close icon close-reveal-modal"></i> 
    <div class="header"> 
     Bow tie neck silk overlay top/dress with sequin hem – cream, grey           <p>£0</p> 
    </div> 
    <div class="content"> 
     <img src="http://dev.birddartmouth.co.uk/wp-content/uploads/2013/10/096.jpg"> 
    </div> 
</div><!-- /modal --> 

的foundation.min.js和foundation.reveal.js文件都在頭部加載。我按照基金會文檔上的說明(http://foundation.zurb.com/docs/components/reveal.html) - 任何人都可以看到我做錯了什麼嗎?

回答

0

代碼沒有問題。您可以嘗試手動打開模式使用jQuery

<a href="#" class="item" data-reveal-id="292"> 
<img src="http://dev.birddartmouth.co.uk/wp-content/uploads/2013/10/096.jpg" width="200" height="200"> 

<div id="292" class="reveal-modal"> <i class="close icon close-reveal-modal">x</i> //x for close button 

    <div class="header">Bow tie neck silk overlay top/dress with sequin hem – cream, grey 
     <p>£0</p> 
    </div> 
    <div class="content"> 
     <img src="http://dev.birddartmouth.co.uk/wp-content/uploads/2013/10/096.jpg"> 
    </div> 
</div> 

jQuery的

$(document).on('click', '.item', function() { 
    var id = $(this).attr('data-reveal-id'); 
    $('#' + id).foundation('reveal', 'open'); 
}); 


$(document).on('click', '.close-reveal-modal', function() { 

    $(this).parent().foundation('reveal', 'close'); 
}); 

的jsfiddle http://jsfiddle.net/rFLE3/

+0

感謝 - 這正是我終於實現了,它現在的作品。 – babbaggeii