2017-05-03 119 views
0

我想显示模式,当它点击“报告”,但它不显示模式。如何解决这个错误,请帮助我。Bootstrap模式未显示。如何解决?

网址:

http://newseinstein.com/Rwork/index.php/Pet/view/104 

HTML:

<span class="text"> 
     <a href="#" class="button" data-toggle="modal" data-target="locationreport" id="reportpet">Report</a> 
    </span> 

模态代码:

<div class="modal fade" id="locationreport" role="dialog" style="display: none;"> 
<div class="modal-dialog"> 

    <!-- Modal content--> 
    <div class="modal-content"> 
    <div class="modal-header"> 
     <button type="button" class="close" data-dismiss="modal">&times;</button> 
     <h4 class="modal-title">Modal Header</h4> 
    </div> 
    <div class="modal-body"> 
     <p>Some text in the modal.</p> 
    </div> 
    <div class="modal-footer"> 
     <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> 
    </div> 
    </div> 

</div> 

JS代码:

$("#reportpet").click(function(){ 
    $("#locationreport").show(); 
    }) 
+0

id之前添加#当使用引导模式没有必要additioanl的Jquery/JS。你是否在文档中包含引导程序js文件? – empiric

+0

@empiric是的我正在加载bootstrap.js –

+0

您可能正在寻找这个https://jsfiddle.net/girish28892/DTcHh/32322/ –

回答

3

您的数据目标更改为data-target="#locationreport"您需要的模式

<span class="text"> 
     <a href="#" class="button" data-toggle="modal" data-target="#locationreport" id="reportpet">Report</a> 
</span> 

See bootply