I have a slider of 14 elements. It is necessary under the slider line - 4 blocks with inscriptions: first, second, third, fourth. I coped with it. I want, depending on which group the block is from, its name is framed
- the first five blocks in the first group,
- four following in the second
- three following in the third
- the last two in the fourth
and
<div class="jMyCarousel"> <ul> <li class="1"><div class="news-text"><p>!1!Text</p></div></li> <li class="1"><div class="news-text"><p>!2!Text</p></div></li> <li class="1"><div class="news-text"><p>!3!Text</p></div></li> <li class="1"><div class="news-text"><p>!4!Text</p></div></li> <li class="1"><div class="news-text"><p>!5!Text</p></div></li> <li class="2"><div class="news-text"><p>!6!Text</p></div></li> <li class="2"><div class="news-text"><p>!7!Text</p></div></li> <li class="2"><div class="news-text"><p>!8!Text</p></div></li> <li class="2"><div class="news-text"><p>!9!Text</p></div></li> <li class="3"><div class="news-text"><p>!10!Text</p></div></li> <li class="3"><div class="news-text"><p>!11!Text</p></div></li> <li class="3"><div class="news-text"><p>!12!Text</p></div></li> <li class="4"><div class="news-text"><p>!13!Text</p></div></li> <li class="4"><div class="news-text"><p>!14!Text</p></div></li> </ul> </div> <div class="buttom_block"> <ul> <li> 1_блок </li> <li> 2_блок </li> <li> 3_блок </li> <li> 4_блок </li> </ul> </div>
The question is how to recognize the 1st element in the block. I want to compare the first element: if it is <li class="1">
, then highlight the first block. Help me find the position of the first element.
All program code can be downloaded here . Password 1234.
Thank you very much.