gpt4 book ai didi

javascript - 如何在jquery中隐藏数据过滤器?

转载 作者:行者123 更新时间:2023-12-01 05:35:21 25 4
gpt4 key购买 nike

有人知道如何在页面加载时隐藏 ListView 的数据过滤器吗?

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<table class="table3">
<tbody>
<tr>

<td>
<a class="profileinfo1">
<center><font size="5">8</font>
</center>Service Called</a>
</td>

</tr>
</tbody>
</table>

<ul data-role="listview" data-autodividers="true" data-filter="true" data-inset="true" class="friend">
<li>Adam Kinkaid</li>
<li>Matthew</li>
<li>Owen</li>
<li>Ryan</li>
<li>William</li>
</ul>

<ul data-role="listview" data-inset="true" class="transaction">

<li data-role="list-divider"><font size="3">Cash Transaction</font>
</li>
<li data-icon="info"><u><b>4th November 2015</b></u>
<br>Service called: Plumbling
<br>Service by: Timothy Tan
<br>Payment made: $40</li>
<li data-icon="info"><u><b>14th June 2015</b></u>
<br><b>Service called:</b>Computer Repair
<br>Service by: Jonathan Tan Wee Hong
<br>Payment made: $150</li>
<li data-icon="info"><u><b>12th January 2014</b></u>
<br><b>Service called:</b>Lock Smithing
<br>Service by: Adul Rashim
<br>Payment made: $50</li>

<li data-role="list-divider"><font size="3">Credit Card</font>
</li>
<li data-icon="info"><u><b>18th July 2015</b></u>
<br>Service called: LockSmithing
<br>Service by: Adul Rashim
<br>Payment made: $50
<br>Card Used: Mastercard</li>
<li data-icon="info"><u><b>21th March 2014</b></u>
<br>Service called: Computer Repair
<br>Service by: Jonathan Tan Wee Hong
<br>Payment made: $90
<br>Card Used: Visacard</li>
<li data-icon="info"><u><b>15th November 2013</b></u>
<br>Service called: Air-Con Repair
<br>Service by: Hong Xin Chang
<br>Payment made: $60
<br>Card Used: Visacard</li>
<li data-icon="info"><u><b>10th May 2013</b></u>
<br>Service called: Plumbling
<br>Service by: Timothy Tan
<br>Payment made: $200
<br>Card Used: Mastercard</li>
<li data-icon="info"><u><b>12th January 2013</b></u>
<br>Service called: Air-Con Repair
<br>Service by: Hong Xin Chang
<br>Payment made: $170
<br>Card Used: Mastercard</li>
</ul>
</body>
</html>

我想做的另一件事是在单击类时隐藏数据过滤器。例如:

$(document).ready(function(){
$(".profileinfo3").click(function(){
$(".friend").hide();
});
});

The search bar i wish to hide

最佳答案

这是一个片段,当您点击“名为服务”时,搜索框将根据您的评论隐藏。

function click(){
this.nextElementSibling.style.display="none";

}
document.getElementsByClassName('table3')[0].addEventListener('click',click,false)
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<table class="table3">
<tbody>
<tr>

<td>
<a class="profileinfo1">
<center><font size="5">8</font>
</center>Service Called</a>
</td>

</tr>
</tbody>
</table>

<ul data-role="listview" data-autodividers="true" data-filter="true" data-inset="true" class="friend">
<li>Adam Kinkaid</li>
<li>Matthew</li>
<li>Owen</li>
<li>Ryan</li>
<li>William</li>
</ul>

<ul data-role="listview" data-inset="true" class="transaction">

<li data-role="list-divider"><font size="3">Cash Transaction</font>
</li>
<li data-icon="info"><u><b>4th November 2015</b></u>
<br>Service called: Plumbling
<br>Service by: Timothy Tan
<br>Payment made: $40</li>
<li data-icon="info"><u><b>14th June 2015</b></u>
<br><b>Service called:</b>Computer Repair
<br>Service by: Jonathan Tan Wee Hong
<br>Payment made: $150</li>
<li data-icon="info"><u><b>12th January 2014</b></u>
<br><b>Service called:</b>Lock Smithing
<br>Service by: Adul Rashim
<br>Payment made: $50</li>

<li data-role="list-divider"><font size="3">Credit Card</font>
</li>
<li data-icon="info"><u><b>18th July 2015</b></u>
<br>Service called: LockSmithing
<br>Service by: Adul Rashim
<br>Payment made: $50
<br>Card Used: Mastercard</li>
<li data-icon="info"><u><b>21th March 2014</b></u>
<br>Service called: Computer Repair
<br>Service by: Jonathan Tan Wee Hong
<br>Payment made: $90
<br>Card Used: Visacard</li>
<li data-icon="info"><u><b>15th November 2013</b></u>
<br>Service called: Air-Con Repair
<br>Service by: Hong Xin Chang
<br>Payment made: $60
<br>Card Used: Visacard</li>
<li data-icon="info"><u><b>10th May 2013</b></u>
<br>Service called: Plumbling
<br>Service by: Timothy Tan
<br>Payment made: $200
<br>Card Used: Mastercard</li>
<li data-icon="info"><u><b>12th January 2013</b></u>
<br>Service called: Air-Con Repair
<br>Service by: Hong Xin Chang
<br>Payment made: $170
<br>Card Used: Mastercard</li>
</ul>
</body>
</html>

关于javascript - 如何在jquery中隐藏数据过滤器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34482580/

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