动态JQUERY无法正常工作

时间:2015-12-08 17:43:35

标签: php jquery mysql html5

<?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>

php部分正在运行,但基于id的标签不能很好地对齐           我的回声数据目前是垂直对齐的 如何使标签再次工作? 数据也由子弹分隔,它没有作为标签对齐

1 个答案:

答案 0 :(得分:0)

<?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>