[mysql]动态的 JQUERY 不工作

标签: html5 jQuery MySQL PHP
发布时间: 2016/10/23 5:49:01
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.
<?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:

<?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>
官方微信
官方QQ群
31647020