2017-09-04 65 views
0

我有我的旋轉木馬代碼在file2.php。它工作正常。 但是,當我嘗試將其加載到file1(div myhome)的標籤內容中時,傳送帶僅保持靜態。在標籤內容的CSS文件: '塊顯示',但沒有工作Bootstrap旋轉木馬不在丸內容中工作

file1.php:我嘗試添加

<ul id="mainpill" class="nav nav-pills nav-justified"> 
    <li id="tab0"> 
    <a data-toggle="pill" href="#home"> 
     <span class="glyphicon glyphicon-home"></span> 
    </a> 
    </li> 
</ul> 
<div class="tab-content"> 
    <div id="home" class="tab-pane fade in active"> 
    <div id="myhome"></div> 
    </div> 
</div> 

file2.php:

carousel code 

file3.js:

$('#tab0').click(function() { 
    $('#myhome').load('file2.php'); 
}); 

回答

0

請改變你的file1.php和file3.js代碼:

file1.php 

    <ul id="mainpill" class="nav nav-pills nav-justified"> 
     <li id="tab0">  
     <a href ="#" onclick="load_home()"> 
      <span class="glyphicon glyphicon-home"></span> 
     </a> 

     </li> 
    </ul> 
    <div class="tab-content"> 
     <div id="home" class="tab-pane fade in active"> 
     <div id="myhome"></div> 
     </div> 
    </div> 

**file3.js** 


function load_home() { 
    document.getElementById("myhome").innerHTML='<object type="text/html" data="File2.php" ></object>'; 
}