Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

JQuery, I need an advice in selection?

jQuery jquery

  • Please log in to reply
No replies to this topic

#1 Stasonix

Stasonix

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 115 posts
  • Programming Language:C++, PHP, JavaScript, Delphi/Object Pascal, Pascal
  • Learning:C++, PHP, JavaScript, Delphi/Object Pascal

Posted 22 December 2011 - 11:06 AM

I wanna choose next <a> tag, when I hovering current <a> in the ul, how it to do?


<ul class='mainli'>
<li><a href="#">unos</a>
<ul>
<li> item 1 </li>
<li> item 2 </li>
<li> item 3 </li>
<li> item 4 </li>
</ul>
</li>
<li><a href="#">dos</a>
<ul>
<li> item 1 </li>
<li> item 2 </li>
<li> item 3 </li>
<li> item 4 </li>
</ul>
</li>
<li><a href="#">tres</a>
<ul>
<li> item 1 </li>
<li> item 2 </li>
<li> item 3 </li>
<li> item 4 </li>
</ul>
</li>
</ul>


/*
I need to select DOS, when I hovering UNOS, and if I hovering dos I need to select in selector tres, .. etc.
*/

$('.mainli a').hover(function(){
  // lets next |a| will with border 1px solid black;
    
});


welcome on my fiddle: Edit this Fiddle - jsFiddle - Online Editor for the Web (JavaScript, MooTools, jQuery, Prototype, YUI, Glow and Dojo, HTML, CSS)
  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download