> I could certainly use a copy of this as well if it is cross-browser
compatible.

 

Alright, here you go.  Turns out the versions of genericNav from FarCry 3
and 4 are quite different (but not for this part).  I can't really send my
file because I've customized it so much for other CSS requirements that they
aren't relevant to your question.

 

So what this code does is add a class called "sub" to the parent <li>, then
add a class of "top" to the first child element <li>, and finally adds a
class of "bottom" to the last <li> in that child list.

 

You can easily modify these to place the classes on the anchor tags if
needed (or just use different class names all together).

 

1.       In the <cfparam> area add the following:

<cfparam name="attributes.bTop" default="0" /> <!--- If this item is the
first list item of a child nav, add class to li called "top" --->

<cfparam name="attributes.bBottom" default="0" /> <!--- If this item is the
last list item of a child nav, add class to li called "bottom" --->

 

2.       Find the string "//update counters.  After the variables are set
for "previouslevel" and "currentlevel" add the following:

nextlevel=qNav.nLevel[i+1];

 

3.       Find the string "// open a list item". Above that line add the
following code:

// (JSC) If this is the first list item in a child, add "top" class

if (attributes.bTop eq true and currentlevel gt previouslevel){

itemclass=itemclass & 'top ';

}

// (JSC) If this list item has a child nav, add "sub" class

if (currentlevel lt nextlevel){

itemclass=itemclass & 'sub ';

}

// (JSC) If this list item is the last of a sub nav, add "bottom" class

if (attributes.bBottom eq true and currentlevel gt nextlevel){

itemclass=itemclass & 'bottom ';

}

4.       When calling the tag add the attributes bTop="1" and bBottom="1"
(and I suggest first copying the genericNav from core and placing it in
<project>/tags/webskin/ (and calling that one instead since its custom).

 

 

That's it.  Feel free to modify as needed.

 

 

---

Jeff Coughlin

Web Application Developer

 <http://www.jeffcoughlin.com/> http://www.jeffcoughlin.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to