drsb77336 2015-12-08 17:43
浏览 65
已采纳

动态JQUERY无法正常工作

<?php
include("dbFunctions.php");
$query ="SELECT * FROM medical_category";

$result = mysqli_query($link,$query);
//datebase query
?>
<!doctype html>

<html lang="en">
<head>
<meta charset="utf-8">
<title>Official form</title>
<link rel="stylesheet" type="text/css" href="stylesheets/jquery-ui.css" />
<script language="javascript" type="text/javascript" src="scripts/jquery-    1.10.2.min.js"></script>

<script language="javascript" type="text/javascript" src="scripts/jquery-ui.js"></script>
 //javascript
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>

// tabs function

</head>
<body>

<div id="tabs">

   <?php while ($arrayResult = mysqli_fetch_array($result)){ ?>

  // fetch the array , is the vertical data affecting the alignment of tabs

    <li><a href="#tabs-<?php echo $arrayResult['Medical_category_id']?> "><? php echo $arrayResult['Medical_categoryName']; ?></a></li>

the php part is working but the tabs based on the id is not aligning well my echo data is currently vertically aligned how to make the tabs work again? the data are also separated by bullets , it is not aligned as a tab suppose to be

  • 写回答

1条回答 默认 最新

  • douyi1197 2015-12-08 18:11
    关注
    <?php
    include("dbFunctions.php");
    $query ="SELECT * FROM medical_category";
    $result = mysqli_query($link,$query);
    ?>
    <html>
    <head>
      <meta charset="utf-8">
      <title>Official form</title>
      <link rel="stylesheet" type="text/css" href="stylesheets/jquery-ui.css" />
      <script src="//code.jquery.com/jquery-1.10.2.js"></script>
      <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
      <script>
      $(function() {
        $('#tabs li>div').appendTo('#tabs');
        $( "#tabs" ).tabs();
      });
      </script>
    </head>
    <body>
    <div id="tabs">
      <ul>
        <?php while ($arrayResult = mysqli_fetch_array($result)){ ?>
        <li><a href="#tabs-<?php echo $arrayResult['Medical_category_id']?>"><?php echo $arrayResult['Medical_categoryName']; ?></a>
        <div id="tabs-<?php echo $arrayResult['Medical_category_id']?>"><p>content of the tab</p></div></li>
        <?php };?>
      </ul>
    </div>
    </body>
    </html>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度