gpt4 book ai didi

php - 动态 JQUERY 不工作

转载 作者:行者123 更新时间:2023-11-30 22:29:50 24 4
gpt4 key购买 nike

<?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 的选项卡没有很好地对齐 我的 echo 数据目前是垂直对齐的如何使选项卡再次工作?数据也用项目符号分隔,它没有像标签那样对齐

最佳答案

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

关于php - 动态 JQUERY 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34162513/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com