我最近做了一些改變,讓一些圖標成爲使我的網站上顯示twitter-bootstrap模式的按鈕,現在我得到錯誤:Twitter Bootstrap:未捕獲TypeError:對象模態1沒有方法「切換」
Uncaught TypeError: Object modal1 has no method 'toggle'
模態顯示中斷,或根本沒有出現在某些情況下(有很多動態創建的)。下面是相關代碼:
的按鈕HTML:
<a data-toggle="modal" href="#myModal-{{$artist->id}}" class="Details">
<span class="fa-stack">
<i class="fa fa-circle-o fa-stack-2x"></i>
<i class="fa fa-plus fa-stack-1x"></i>
</span>
</a>
HTML模式:
<div id="myModal-{{$artist->id}}" class="modal hide fade side-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times fa-lg"></i></button>
</div>
<div class="modal-body">
<article class="musicainDEtailImgBox"> <a href="#"><img src="{{$artist->image_path}}" alt="" title="" width="240" height="240"></a>
<h5>{{$artist->stage_name}}</h5>
</div>
</div>
</div>
任何想法,這是爲什麼發生?我正在使用字體真棒圖標的圖標。
編輯:
JavaScript控制檯錯誤引用bootstrap.js的1008行:
if (!data) $this.data('modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option]()
請將您的腳本包含或在jsfiddle上演示 –
您使用的是bootstrap 2.x.x還是3.x.x?在bs 3中,模態沒有class'hide'。 – Ravimallya
它的版本2.3.2 – user1072337