Need to select all elements with same class except the one
I am a newby i hope i chose right forum thread.
I have made a vertical sliding blocks in a sidebar menu (here is what i work at:
http://present-on-don.ru )
so i need to all elements except the clicked one to slide back so thaat the same time only one element is open.
So i need to chose all the elements with class "arrowm" except the one i click on. How can i do that? I cant use siblings or children or if i use "find" then how do i exclude the one i click?
many thanks for any kind of help.Google is difficult to use here cause the problem is not very general i sppse.
here is html:
- <ul class="catalog menu"><li class="expanded"><span class="trail"><a href="/catalog/animirovannye-igrushki">Анимированные игрушки (40)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/myagkie-igrushki-0">Мягкие игрушки (4)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/breloki-podveski">Брелоки, подвески (2)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/vazy">Вазы (1)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/vozdushnye-shariki">Воздушные шарики (3)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/diplomy">Дипломы (89)</a></span>
- <ul class="menu"><div class="arrowm"><img src="/sites/all/themes/podarok/images/menuarrow.gif"></div><li class="expanded" style="display: none; "><span class="trail"><a href="/catalog/diplomy-shutochnye">Дипломы шуточные (35)</a></span>
- </li><li class="expanded" style="display: none; "><span class="trail"><a href="/catalog/diplomy-svadebnye">Дипломы свадебные (8)</a></span>
- </li><li class="expanded" style="display: none; "><span class="trail"><a href="/catalog/diplomy-k-yubileyu">Дипломы к юбилею (2)</a></span>
- </li></ul>
- </li><li class="expanded"><span class="trail"><a href="/catalog/dlya-avto">Для авто (15)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/dlya-kompyutera">Для компьютера (29)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/igry">Игры (15)</a></span>
- <ul class="menu"></ul>
- </li><li class="expanded"><span class="trail"><a href="/catalog/kartiny">Картины (16)</a></span>
- <ul class="menu"><div class="arrowm"><img src="/sites/all/themes/podarok/images/menuarrow.gif"></div><li class="expanded" style="display: none; "><span class="trail"><a href="/catalog/gobelen">Гобелен (5)</a></span>
- </li><li class="expanded" style="display: none; "><span class="trail"><a href="/catalog/3d-2030">3D 20*30 (3)</a></span>
- </li></ul>
- </li><li class="expanded"><span class="trail"><a href="/catalog/keramika-farfor-polistoun">Керамика, фарфор, полистоун (7)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/klyuchnicy-aptechki">Ключницы, аптечки (3)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/kopilki">Копилки (15)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/dekorativnaya-kosmetika">Косметика (52)</a></span>
- <ul class="menu"><div class="arrowm"><img src="/sites/all/themes/podarok/images/menuarrow.gif"></div><li class="expanded" style="display: none; "><span class="trail"><a href="/catalog/kosmetika-tropical-mists">Косметика "Tropical Mists" (13)</a></span>
- </li><li class="expanded" style="display: none; "><span class="trail"><a href="/catalog/dekorativnaya-kosmetika-bremani">Декоративная косметика "Bremani" (13)</a></span>
- </li></ul>
- </li><li class="expanded"><span class="trail"><a href="/catalog/kuritelnye-prinadlezhnosti">Курительные принадлежности (10)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/magnity">Магниты (2)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/medali-suvenirnye">Медали сувенирные (33)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/na-kuhnyu">На кухню (15)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/neobychnye-podarki">Необычные подарки (54)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/nochniki-proektory-svetilniki">Ночники Проекторы Светильники (4)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/oblozhki-na-dokumenty">Обложки на документы (93)</a></span>
- <ul class="menu"><div class="arrowm"><img src="/sites/all/themes/podarok/images/menuarrow.gif"></div><li class="expanded"><span class="trail"><a href="/catalog/oblozhki-na-pasporta">Обложки на паспорта (24)</a></span>
- </li><li class="expanded"><span class="trail"><a href="/catalog/oblozhki-na-voditelskie-dokumenty">Обложки на водительские документы (23)</a></span>
- </li></ul>
here is my jquery code where i insert <img> into the menu body after the headings and use this img to click it then.
- jQuery(document).ready(function(){
- jQuery('.block-uc-catalog li.expanded li.expanded:first-child').before('<div class="arrowm"><img src="/sites/all/themes/podarok/images/menuarrow.gif"></img></div>');
- jQuery('.arrowm').click(function(){
- jQuery(this).siblings().slideToggle("fast");
- });
- });