Javascript.RU

Создать новую тему Ответ
 
Опции темы Искать в теме
  #1 (permalink)  
Старый 03.10.2013, 18:53
Новичок на форуме
Отправить личное сообщение для kate1988 Посмотреть профиль Найти все сообщения от kate1988
 
Регистрация: 03.10.2013
Сообщений: 1

Помогите развернуть первый блок в выпадающих списках?
Помогите развернуть первый блок в выпадающих списках? Ha данный момент блоки все идут свернуты, а мне нужно сделать, что б первый блок был развернут, а остальные свернуты?

HTLM
<div class="updates">
<div style="color: #000000;">From BlackBerry</div>
<ul class="news list">
<li class="second"><span class="click" style="color: #959595;" onmouseover="this.style.color='black';" onmouseout="this.style.color='#959595';">v.1.1.0.181                                                      Current release<br /></span>
<div class="block">
<div class="block">- Major game play optimization</div>
<div class="block">- Fixed all problems with sticky gas and brake pedals on all BlackBerry Z10 and Q10 devices</div>
</div>
</li>
<li class="second"><span class="click" style="color: #959595;" onmouseover="this.style.color='black';" onmouseout="this.style.color='#959595';">v.1.1.0.122<br /></span>
<div class="block">- Added 6 driver characters with unique weights and heights. Every vehicle drives differently depending on the driver: John Smith, Forester, Blonde, Cowboy, Croft Girl, Astronaut</div>
<div class="block">- Added 3 new tracks: Ice, Desert, City. More tracks to come!</div>
<div class="block">- Added new vehicle: Racing Bike. More vehicles to come!</div>
</li>
<li class="second"><span class="click" style="color: #959595;" onmouseover="this.style.color='black';" onmouseout="this.style.color='#959595';">v.1.0.0.90 </span>
<div class="block">- Added ability to buy more coins using In-App Purchases</div>
<div class="block">- Now you can instantly upgrade your car and unlock other cars without the need to earn more coins in the Game!</div>
</li>
<li class="second"><span class="click" style="color: #959595;" onmouseover="this.style.color='black';" onmouseout="this.style.color='#959595';">v.1.0.0.20 </span>
<div class="block">- Performance optimization</div>
<div class="block">- Fixing flicking problems on some devices</div>
<div class="block">- Minor bug fixes</div>
</li>
<li class="second"><span class="click" style="color: #959595;" onmouseover="this.style.color='black';" onmouseout="this.style.color='#959595';">v.1.0.0.4 </span>
<div class="block">- Added initial support for BlackBerry Q10</div>
</li>
<li class="second"><span class="click" style="color: #959595;" onmouseover="this.style.color='black';" onmouseout="this.style.color='#959595';">v.1.0                                                                First tracked<br /></span>
<div class="block">Hill Racing is physics based car racing game. Start with Jeep car, drive dangerous hills and collect coins. Use collected coins to buy new cars and upgrade them. Better upgrades allow you to drive far and far away and collect even more coins. Get bonus coins for flips and back flips of your car – but watch out your neck! If you break it – your ride will be abruptly over!</div>
</li>
</ul>
</div>


CSS
<style>
.block {
display: none;

}

.click {
cursor: pointer;
}

.second {
background: none repeat scroll 0 0 #EEEEEE;
border: 1px solid #CCCCCC;
display: block;
margin-bottom: 3px;
padding-bottom: 3px;
padding-left: 5px;
padding-top: 3px;
width: 400px;
}
.updates list{ list-style: inline;}
li.hover{
color: #000000;
}

ul{
list-style: none outside none;

}
</style>


<script charset="utf-8" type="text/javascript">
$(function(){		
$('.click').click(function(){
var block$ = $(this).closest('li').find('.block');
if (block$.is(':hidden')) {
block$.show();
}
else {
block$.hide();
}
});
});
</script>
Ответить с цитированием
  #2 (permalink)  
Старый 07.10.2013, 13:55
Аватар для ksa
ksa ksa вне форума
CacheVar
Отправить личное сообщение для ksa Посмотреть профиль Найти все сообщения от ksa
 
Регистрация: 19.08.2010
Сообщений: 14,118

Сообщение от kate1988
Помогите развернуть первый блок в выпадающих списках?
.block {
 display: none;
}
Как вариант, добавить
.block:first-child {
 display: block;
}
Ответить с цитированием
Ответ



Опции темы Искать в теме
Искать в теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Копирование блоков в блок maximus Events/DOM/Window 1 14.09.2013 19:40
Скрыть/показать блок в зависимости от radio MBmusic Элементы интерфейса 10 08.05.2013 17:23
Если один уже открыт и при нажатии на ссылку два первый блок скрывался и открывался ybiza Элементы интерфейса 3 16.12.2010 22:24