i found part of problem still needs work. want achieve when hover on div, others divs should have class added them if original class same. let's start.
i have menu:
<ul id="listz"><li class='has-sub'><a href='/produse/trape-de-fum-si-ventilatie/'><span>smoke vents</span></a> <ul> <li class='has-sub'><a href='/produse/trape-de-fum-si-ventilatie/trape-de-fum/'><span>trape de fum</span></a> <ul> <li><a href='/rokvent-simplu-canat'>rokvent simplu canat</a></li> <li><a href='/pheonix-dublu-canat'>phönix dublu canat</a></li> <li><a href='/megaphonix'>megaphönix</a></li> <li><a href='/megastar'>megastar</a></li> <li><a href='/firefighter'>firefighter</a></li> <li><a href='/smokejet'>smokejet</a></li> <li class='last'><a href='/multijet'>multijet</a></li> </ul> </li> <li class='has-sub'><a href='/produse/trape-de-fum-si-ventilatie/trape-de-ventilatie-si-vizitare/'><span>trape de ventilatie si vizitare</span></a> <ul> <li><a href='/rokvent-luminatoare-fixe'>rokvent(luminatoare fixe)</a></li> <li class='last'><a href='/rokpas-luminatoare-acces'>rokpas(luminatoare acces)</a></li> </ul> </li> </ul> </li></ul> as can see have parent "smoke vents" has children. menu on left side. on right side have picture warehouse has smoke vent elements. when hover on them, change color.
at moment menu needs open , show associated product in menu. when hover on element of warehouse should add class menu can change background , show that element product or products.
one problem need match them class (wich make unique each element).
the second problem menu not open when hover on part of image. if have menu open can see highlighted item in menu.
this code got , hovering part matching in order.(what mean if add parents class shows right if add child last parent not have addclass):
<script type="text/javascript"> $("#listz1 li,#listz2 li").hover(function() { var index = $(this).index(); $("#listz1, #listz2").each(function() { $(".link1",this).eq(index).toggleclass("hoverz"); }); }); </script>
Comments
Post a Comment