HighDots Forums  

Superfish - Last-child and Parent class at the same time

jQuery jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.


Discuss Superfish - Last-child and Parent class at the same time in the jQuery forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Goh Hao-Wei
 
Posts: n/a

Default Superfish - Last-child and Parent class at the same time - 11-03-2009 , 10:14 AM






Hello,

How do I get a <li> item to have both the Parent and the Last-Child
class at the same time? Reason is, I'm making use of Last-child class
to control the borders for the last item in a sub menu, but I'm having
difficulties when the last-child has its own sub menu, making it only
having the parent class without the last-child class.

Reply With Quote
  #2  
Old   
Charlie
 
Posts: n/a

Default Re: [jQuery] Superfish - Last-child and Parent class at the same time - 11-06-2009 , 09:51 PM






a bit hard to answer without knowing what method you are using to set classes...js or html markup

one method may help, using the onBeforeShow option . "this" used in a function in onBeforeShow refers to the UL about to be shown

you could try $(this).parent("li").siblings("li;last").addClass( "yourLastchildClass"). Likely several other ways depending on how you're markup is generated and how you are currently setting classes

Goh Hao-Wei wrote:

Hello, How do I get a &lt;li&gt; item to have both the Parent and the Last-Child class at the same time? Reason is, I'm making use of Last-child class to control the borders for the last item in a sub menu, but I'm having difficulties when the last-child has its own sub menu, making it only having the parent class without the last-child class.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.