2013-03-15 25 views
0

我正在將內容加載到twitter引導模式中,而我遇到的問題是內容相當長,這就需要一個側邊欄。這個內容是一個簡單的html頁面。而不是使用模式側邊欄它使用iframe,並且我看到的每個位置都是將外部內容導入twitter boostraps模式的唯一方法。iframes不可能是解決方法嗎?

<p><a data-toggle="modal" class="updateNotes" href="http://adambalan.com/aisis/aisis_update/UpdateNotes/index.html" data-target="#modal">READ MORE ABOUT IT!</a></p> 

    <div class="modal hide fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 
     <div class="modal-header"> 
     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 
     <h3 id="myModalLabel">Latest Updates!</h3> 
     </div> 
     <div class="modal-body"> 
     </div> 
    <div class="modal-footer"> 
     <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> 
    </div> 
    </div> 

jQuery的:

$('a.btn').on('click', function(e) { 
    e.preventDefault(); 
    var url = $(this).attr('href'); 
    $(".modal-body").html('<iframe width="100%" height="100%" frameborder="0" scrolling="yes" allowtransparency="true" src="'+url+'"></iframe>'); 
}); 

我需要不使用的iframe,並使用情態動詞側邊欄的內容滾動。任何想法?

我也嘗試關閉iframe中的滾動,但內容不滾動。

回答

0

試過jQuery的加載函數?

http://api.jquery.com/load/

當內容來自其他域可能無法正常工作。

+0

你能提供一個如何實現這個js小提琴嗎?我已經通讀了文檔,但我不確定這會起作用。 – TheWebs 2013-03-16 00:15:53

相關問題