Quick Nav:  Online Store   |   Login | Register

alternating bgcolor

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
keston
<50 Posts
Posts:20


02/04/2008 4:44 AM  

Is it possible to define (possibly in the .template file) that the li's of Level1 get an alternating bgcolor? So i'm not talking about tab-dependend colors, but pure in the .template...

Keston

John Mitchell
Posts:3276


02/04/2008 6:56 AM  
I can't think of a way to do it alternating with the current template parser unless you wanted to use Javascript. I may be able to add that ability, but I'll have to give it some thought first.
keston
<50 Posts
Posts:20


02/07/2008 3:41 AM  

gave it any thought yet?

Could you give me a few standard templates please, so I can try something myself? Lets say the standard template for NavType Tabs, ActiveChildTabs and Hover....that would be great!!

Keston

keston
<50 Posts
Posts:20


02/28/2008 9:49 AM  

bump

John Mitchell
Posts:3276


02/28/2008 10:11 AM  

Hi Keston,
Sorry I missed this earlier.  All the sample skins are in the download package.  You may want to start with the Suckerfish template example.

I have attached that one and a couple others to this post.


Attachment: 1228115722671.zip
Attachment: 1228115725754.zip
Attachment: 1228115725758.zip

keston
<50 Posts
Posts:20


02/28/2008 10:27 AM  

thanks for the effort John, but i'm specifically looking for the _default_ code that is used for NavType Tabs (and having the templates for ActiveChildTabs and Hover would be nice too)

Keston

John Mitchell
Posts:3276


02/28/2008 10:33 AM  
I don't understand what you mean by _default_ code for NavType Tabs.
keston
<50 Posts
Posts:20


02/28/2008 10:40 AM  

right now I'm not using any template, but the ul's and li's áre formed a certain way. This is probably done a default way in Snapsis.DNN.NavMenu.dll

I'd like to use a template that corresponds with this.

John Mitchell
Posts:3276


02/28/2008 10:51 AM  
Ok,
The suckerfish skin sample is a template that is the same as NavType="Hover"

The ActiveResetHover sample is a combined NavType="Tabs" and NavType="Hover" for ActiveChildTabs done in a template.
keston
<50 Posts
Posts:20


02/28/2008 10:56 AM  

thanks John, I'll give it a go!

keston
<50 Posts
Posts:20


02/29/2008 6:45 AM  

simply past this in your skin:

 

 [script removed]   var commonJS = {
  
   addEvent: function(obj,type,fn) {
  
    if (obj.addEventListener) {
     obj.addEventListener(type,fn,false);
     return true;
    } else if (obj.attachEvent) {
     obj['e'+type+fn] = fn;
     obj[type+fn] = function() { obj['e'+type+fn]( window.event );}
     var r = obj.attachEvent('on'+type, obj[type+fn]);
     return r;
    } else {
     obj['on'+type] = fn;
     return true;
    }
  
   },
  
   stripe: function(tbIndex) {
  
    var tRows = document.getElementById('nav').getElementsByTagName('li');
  
    // var i=0 for odd rows
    // var i=1 for even rows
    for (var i=0, thisRow; thisRow=tRows[i] i+=2) { // increment by 2
     if (thisRow.className == 'Level0') (thisRow.className += (thisRow.className) ? ' even' : 'even');
    }
  
   }
  
  }
  
  commonJS.addEvent(window,'load',commonJS.stripe);
 [script removed]

 

and define some css:

  #nav li.Level0{background-color:#ff0000;}
  #nav li.even{background-color:#ffffff;}

John Mitchell
Posts:3276


02/29/2008 6:51 AM  
Nice work Keston, thanks for posting.

If you could attach it as a txt or zip file then it'll avoid the script removal.

Thanks again, very cool.
keston
<50 Posts
Posts:20


02/29/2008 7:48 AM  

attached the javascript I used in my skin. However I had to use the Replacements to be sure that every li of Level0 got the class Level0 and not 'Level0 SelectedTab' or 'First-Child Level0'. If you want to keep using these classes you must change this in the javascript aswell.

Dont forget to mention these in your css:

#nav li.Level0{background-color:#nicecolor;}
#nav li.even{background-color:#alternatingnicecolor;}

Keston


Attachment: 1229483537471.txt

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.



ActiveForums 3.7
Powered by: Snapsis Software