1
- 私には動作していないタブ: http://johandahl.com/wp/malmocityfastigheter/ekonomi/jQueryのこのページのタブを作るために、いくつかのjQueryを使用してIE6-7
しかし、彼らはインターネットエクスプローラ6-7で作業されていません。タブ付きの領域は隠れておらず、ちょうど積み重なっています。どのようなアイデアがここで間違っているのでしょうか
これは私のjQueryのコードは次のようになります。ここでは
/* TABS */
jQuery(document).ready(function($){
$('ul.tabs').each(function(){
// For each set of tabs, we want to keep track of
// which tab is active and it's associated content
var $active, $content, $links = $(this).find('a');
// Use the first link as the initial active tab
$active = $links.first().addClass('active');
$content = $($active.attr('href'));
// Hide the remaining content
$links.not(':first').each(function() {
$($(this).attr('href')).hide();
});
// Bind the click event handler
$(this).on('click', 'a', function(e){
// Make the old tab inactive.
$active.removeClass('active');
$content.hide();
// Update the variables with the new link and content
$active = $(this);
$content = $($(this).attr('href'));
// Make the tab active.
$active.addClass('active');
$content.show();
// Prevent the anchor's default click action
e.preventDefault();
});
});
});
は、このために、HTMLのサンプルです:たとえばIEとChromeを比較
<ul class='tabs'>
<li><a href='#beskrivning'>Om adressen</a></li>
<li><a href='#aktuellt'>Aktuell information</a></li>
</ul>
<div class="entry-about">
<div id='beskrivning'>
</div>
<div id='aktuellt'>
</div>
</div>
は、Chromeのインラインスタイルすることを示しています「display:block;」と表示:なし;私のjQueryにもエラーはありません。Idea ?????
これらのブラウザでJSエラーが発生しましたか?JSが有効になっていますか? –
私はWindowsマシンではないので、現時点でこれらのブラウザでページをテストすることは実際にはできません。ページスクリーンショットhttp://netrenderer.com/を見て気づきました。 これはそれを見ることができます私は非常に感謝します。 –
タラコピーペーストエラーの可能性が高い最後の部分に '});'があります。次に、HTMLを見て、すべてが適切に開閉されていることを確認します。 –