【问题标题】:change listview color in jQuery-Mobile 1.4.5在 jQuery-Mobile 1.4.5 中更改列表视图颜色
【发布时间】:2018-04-01 17:36:52
【问题描述】:
在我的jQuery-Mobile Listview 中更改一个特定listitem 的background-color 时遇到一些问题。
每个listitem 都有自己的 ID。
我只想换一个。
请帮帮我:)
【问题讨论】:
标签:
php
jquery
jquery-mobile
【解决方案1】:
这是一种可能的方法:
#item-2 .ui-btn {
background-color: aliceblue !important;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link href="https://fonts.googleapis.com/css?family=Jura" rel="stylesheet">
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.css">
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<div data-role="page" id="page-one">
<div data-role="content">
<ul data-role="listview" data-inset="true">
<li data-role="list-divider">Friday, October 8, 2010 <span class="ui-li-count">2</span></li>
<li id="item-1">
<a href="index.html">
<h2>Stephen Weber</h2>
<p><strong>You've been invited to a meeting at Filament Group in Boston, MA</strong></p>
<p>Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.</p>
<p class="ui-li-aside"><strong>6:24</strong>PM</p>
</a>
</li>
<li id="item-2">
<a href="index.html">
<h2>jQuery Team</h2>
<p><strong>Boston Conference Planning</strong></p>
<p>In preparation for the upcoming conference in Boston, we need to start gathering a list of sponsors and speakers.</p>
<p class="ui-li-aside"><strong>9:18</strong>AM</p>
</a>
</li>
<li data-role="list-divider">Thursday, October 7, 2010 <span class="ui-li-count">1</span></li>
<li id="item-3">
<a href="index.html">
<h2>Avery Walker</h2>
<p><strong>Re: Dinner Tonight</strong></p>
<p>Sure, let's plan on meeting at Highland Kitchen at 8:00 tonight. Can't wait!</p>
<p class="ui-li-aside"><strong>4:48</strong>PM</p>
</a>
</li>
</ul>
</div>
</div>
</body>
</html>