jquery - How to keep dynamic item behavior after clicking any item in the list? -
i have menu this. can view on website under products tab
firstly, please hover on products.
if hover on items in list, content in right pane changed dynamically. however, if click 1 of them , try hover on other items, content in right pane doesn't change automatically. have click others.
basically, loses it's dynamic behavior after clicking items in left item list.
i had written jquery code think missing something.
$('.urun_tab').hover( function(){ if($(this).hasclass('hoverblock')) return; else $(this).find('a').tab('show'); }); $('.urun_tab').find('a').click( function(){ $(this).parent() .siblings().addclass('hoverblock'); });
this items part on website
<ul class="nav nav-tabs span4"> <li class="active urun_tab"><a href="#a" data-toggle="tab">seksiyonel kapılar<i class="icon-circle-arrow-right icon-2x icon-white"></i></a> </li> <li class="urun_tab" ><a href="#b" data-toggle="tab">otomatik kapılar<i class="icon-circle-arrow-right icon-2x icon-white"></i></a></li> <li class="urun_tab" ><a href="#c" data-toggle="tab">kepenk ve panjur sistemleri<i class="icon-circle-arrow-right icon-2x icon-white"></i></a></li> <li class="urun_tab" ><a href="#d" data-toggle="tab">hangar kapıları<i class="icon-circle-arrow-right icon-2x icon-white"></i></a></li> <li class="urun_tab" ><a href="#e" data-toggle="tab">otomasyon Ürünleri<i class="icon-circle-arrow-right icon-2x icon-white"></i></a></li> <li class="urun_tab" ><a href="#f" data-toggle="tab">yükleme sistemleri<i class="icon-circle-arrow-right icon-2x icon-white"></i></a></li> <li class="urun_tab" ><a href="#g" data-toggle="tab">yangın kapıları<i class="icon-circle-arrow-right icon-2x icon-white"></i></a></li> </ul>
you adding class hoverblock
li
elements when click on link. hover handler written ignore li.unrun_tab
elements have hoverblock
class.
if want hover behavior persist after have clicked on item in product list, have either remove code in click handler adds hoverblock
class, or remove code in hover handler excludes class '.hoverblock` hover processing.
it's bit unclear want behavior be. describing seems want click on product nothing respect adjacent images.
Comments
Post a Comment