我有引导程序的进度条,这是html:
$(".progress-bar").animate({
width: $(this).data('width') + '%'
}, 2500);Run Code Online (Sandbox Code Playgroud)
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="alert alert-success">
<div class="skill-name">ON PROGRESS 357/487</div>
<div class="progress">
<div class="progress-bar progress-bar-primary" role="progressbar" data-width="70">
</div>
</div>
</div>Run Code Online (Sandbox Code Playgroud)
为什么如果我使用jquery上面不工作$(this).data('width') + '%'.但如果我用过$(".progress-bar").data('width') + '%'工作.?谢谢
编辑
如果我使用$(".progress-bar").data('width') + '%'它将改变所有.progress-bar.
我有查询 sql 进行搜索。我有两个表要进行内连接。这是我的桌子:
table_order
------------
id_order id_user_order id_user_taker status
1 2 3 done
2 2 4 done
table_user
--------------
id_user name
1 Alex
2 Jason
3 Danis
4 LorentRun Code Online (Sandbox Code Playgroud)
我会像这样内部加入:
<?php
include'conn.php'
$qry = $conn->query("select table_order.*, table_user.name AS order_name, table_user.name AS taker_name FROM table_order INNER JOIN table_user ON table_user.id_user = table_order.id_user_order INNER JOIN table_user ON table_user.id_user = table_order.id_user_taker ");
while($data = $qry->fetch_assoc()){
echo $data['order_name'] . " " . $data['taker_name'];
}
?>Run Code Online (Sandbox Code Playgroud)
但是,不能显示。请解决我的问题伙计们。非常感谢