在jQuery中创建选项卡

时间:2015-03-24 00:42:53

标签: javascript php jquery html css

我需要一些帮助。我正在尝试这种方式如何使用jQuery创建选项卡,我无法将其应用到我当前的PHP文件。 这是我想申请的示例代码。

<div class="tabbed">
<!-- The tabs -->
<ul class="tabs">
<li class="t1"><a class="t1 tab" title="<?php _e('Tab 1'); ?>"><?php _e('Tab 1'); ?></a></li>
<li class="t2"><a class="t2 tab" title="<?php _e('Tab 2'); ?>"><?php _e('Tab 2'); ?></a></li>
</ul>

<!-- tab 1 -->
<div class="t1">
<!-- Put what you want in here.  For the sake of this tutorial, we'll make a list.  -->
<ul>
    <li>List item</li>
</ul>
</div> <!-- ... --> </div>

<div class="<?php echo $this->wrap_class ?>">
		   <?php $record = new PDb_Template($this); ?>
  <?php while ( $this->have_groups() ) : $this->the_group(); ?>
  <div class="section tabbed" id="<?php echo Participants_Db::$prefix.$this->group->name ?>">
  <?php $this->group->print_title( '<h2>', '</h2>' ) ?>
    <?php $this->group->print_description( '<p>', '</p>' ) ?>
      <?php while ( $this->have_fields() ) : $this->the_field();
          // skip any field found in the exclude array
          if ( in_array( $this->field->name, $exclude ) ) continue;
          // CSS class for empty fields
					$empty_class = $this->get_empty_class( $this->field );
      ?>	 
    <dl class="<?php echo Participants_Db::$prefix.$this->field->name.' '.$this->field->form_element.' '.$empty_class?>">
      <dt class="<?php echo $this->field->name.' '.$empty_class?>"><?php $this->field->print_label() ?></dt>
      <dd class="<?php echo $this->field->name.' '.$empty_class?>">
	  <?php 
        if ($this->field->name == 'edit_link') {
          $this->field->link = $record->get_edit_link();
        }
	  $this->field->print_value()
	  ?>
	  </dd>
    </dl>
    	<?php endwhile; // end of the fields loop ?>
  </div>
  <?php endwhile; // end of the groups loop ?>
</div>

这个的JS和CSS文件都已设置但仍在使用php。

0 个答案:

没有答案