我在默认显示第一个标签时遇到问题。现在它默认显示第二个选项卡。请帮忙。感谢
当有人打开页面时,我想要做的是自动显示第一个标签。
以下是代码:
<div class="tabs hideOnSearch">
<span class="overview-tab">
<?php _e('Detalii','language');?>
</span>
<span class="features-tab active">
<?php _e('Features','language');?>
</span>
<?php $video_source = get_post_meta($post->ID, 'video_meta_box_source', true);
$video_id = get_post_meta($post->ID, 'video_meta_box_videoid', true);
if(($video_source == "vimeo") && !empty($video_id)){ ?>
<?php _e('Video','language');?>
<?php } elseif(( $video_source == "youtube") && !empty($video_id)){ ?>
<span class="video-tab"><?php _e('Video','language');?></span>
<?php } ?>
<div class="item-list">
<ul class="overview">
<?php $trim_length = 200;
$values = get_post_meta($post->ID, 'mod3', true);
if (is_array($values))
{
foreach($values as $value) {
add_filter( 'custom_filter', 'wpautop' );
echo '<p class="car-detail">'.apply_filters( 'custom_filter', $value ).'</p>';}
}
?>
</ul>
<ul class="features active first feature-list">
<?php if (get_the_terms($post->ID, 'features')) {
$taxonomy = get_the_terms($post->ID, 'features');
foreach ($taxonomy as $taxonomy_term) {
?> <li><?php echo $taxonomy_term->name;?></li><?php }
}
?>
</ul>
<ul class="video">
<li><?php $video_source = get_post_meta($post->ID, 'video_meta_box_source', true);
$video_id = get_post_meta($post->ID, 'video_meta_box_videoid', true);
if(($video_source == "vimeo") && !empty($video_id)){ ?>
<iframe src="http://player.vimeo.com/video/<?php echo $video_id; ?>?title=0&portrait=0&color=e275c7" width="478" height="310" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>
<?php } elseif(( $video_source == "youtube") && !empty($video_id)){ ?>
<iframe src="http://www.youtube.com/embed/<?php echo $video_id; ?>" width="478" height="310" frameborder="0" allowfullscreen></iframe>
<?php } ?>
</li>
</ul>
</div>
</div>
<div style="clear:both;"></div>
</div>
答案 0 :(得分:0)
作为一种猜测,如果没有看到Javascript进行显示/隐藏机制,我建议将“活动”类放在HTML的第一个选项卡上并重新加载页面。