2011-11-03 24 views
0

編輯:上傳現場,with images,並with iframes使用jQuery兩個div之間褪色,圖像工作,I幀不

我試圖讓pane1褪色成pane2。它適用於圖像,但我想用iframe來做。這可能嗎?任何輸入是不勝感激。

JS是這樣的:

$(function() { 
$("#tab ul").tabs("#panes > div", {effect: 'fade', fadeOutSpeed: 400}); 
}); 

HTML是這樣的:

<div id="tab"> 
    <ul> 
     <li> 
      <a href="#1">Tab 1</a> 
     </li> 
     <li> 
      <a href="#2">Tab 2</a> 
     </li> 
    </ul> 
</div> 

[...]

<div id="panes"> 
    <div> 
     <iframe src="pane1.html" width="720" height="200" frameborder="0" scrolling="no" /> 
    </div> 
    <div> 
     <iframe src="pane2.html" width="720" height="200" frameborder="0" scrolling="no" /> 
    </div> 
</div> 

在負載pane1 iframe中被顯示爲預期並點擊Tab 2淡出,但它淡化爲無。

然而,它完美的作品使用與上述完全相同的代碼,但在div圖片:

<div id="panes"> 
    <div> 
     <img src="images/pane1.png" /> 
    </div> 
    <div> 
     <img src="images/pane2.png" /> 
    </div> 
</div> 

下面是相關CSS

#tab ul { 
    width:720px; 
    margin: 0 auto 0; 
    left: 0; 
} 

#tab li { 
    float:left; 
    list-style-type:none; 
    margin-top:0px; 
    } 

#tab a { 
    display:block; 
    position:relative; 
    text-decoration:none; 
    color: #5472c0; 
    } 

#tab a.current { 
    color: #272f80; 
    } 

#panes { 
    position:relative; 
    height: 212px; 
    left: 50%; 
    width:720px; 
    margin-left: -360px; 
    margin-top: 16px; 
} 

提前感謝!

編輯:上傳生活,with images,並with iframes

+0

如果您在GitHub上發佈了一個鏈接到頁面的工作版本,這將有所幫助。我無法使用您提供的代碼進行工作。 –

+0

我現在正在上傳它。 – AndrewR

+0

如果您使用Firebug或開發人員工具檢查HTML,則會在iframe示例中看到它從標記中刪除了第二個選項卡的div,而不是隱藏它。這可能是問題所在。但是,爲什麼我不知道。可能是使用插件的錯誤。 – GregL

回答

2

沒有一個線索,爲什麼這個工程,但如果你最終I幀具有完整的標籤,似乎工作。

<div id="here"> 
     <iframe src="http://www.vitalitypilates.com/tabtest/pane1.html" width="720" height="200" frameborder="0" scrolling="no"></iframe> 
    </div> 
    <div id="gone"> 
     <iframe src="http://www.vitalitypilates.com/tabtest/pane2.html" width="720" height="200" frameborder="0" scrolling="no"></iframe> 
    </div> 
+0

完美,非常感謝! – AndrewR