1
我有這樣的HTML頁面:衝突
<div class="rigaEven">
<div class="col1">
<p class="room">AULA B</p>
<p class="where">XXX</p>
</div>
<div class="col2 half">
<p class="when">09:00 - 11:00</p>
</div>
<div class="col3">
<p class="what">WHAT.</p>
<p class="type">Insegnamento</p>
<p class="who">PROF</p>
</div>
</div>
<div class="rigaOdd">
<div class="col1">
<p class="room">AULA WHAT</p>
<p class="where">XXX</p>
</div>
<div class="col2 half">
<p class="when">09:00 - 11:00</p>
</div>
<div class="col3">
<p class="what">KKK</p>
<p class="type">Insegnamento</p>
<p class="who">PROF</p>
</div>
</div>
<div class="rigaEven">
<div class="col1">
<p class="room">AULA MAGNA</p>
<p class="where">XXX</p>
</div>
<div class="col2 half">
<p class="when">09:00 - 11:00</p>
</div>
<div class="col3">
<p class="what">SSS</p>
<p class="type">Insegnamento</p>
<p class="who">PROF</p>
</div>
</div>
<div class="rigaOdd">
<div class="col1">
<p class="room">AULA D</p>
<p class="where">XXX</p>
</div>
<div class="col2 half">
<p class="when">09:00 - 13:00</p>
</div>
<div class="col3">
<p class="what">LAB</p>
<p class="type">Laboratorio</p>
<p class="who">PROF</p>
</div>
</div>
在我的Android活動我隱藏和顯示基於P的值DIV(rigaEven,rigaOdd) (類 「是什麼」 ),這是方法:
public String showActivity(String filter){
return "javascript:(function(){" +
" $(\".rigaEven\").hide();" +
" $(\".rigaOdd\").hide();";+
" $(\".rigaEven:contains("+filter+")\").show();" +
" $(\".rigaOdd:contains("+filter+")\").show();" +
" $(\".what:contains("+filter+")\").show();"+
"})()";
}
但是如果p教室,幷包含「AULA WHAT」 p類也包含什麼「做什麼」仍然可見兩個,但我希望你能看到的只是什麼是字符串傳遞包含什麼在大廳裏,我怎麼辦?