Active
Project:
CCK Fieldgroup Tabs
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2009 at 01:19 UTC
Updated:
30 Sep 2009 at 01:19 UTC
For some reason, the first/last classes weren't being applied correctly for styling.
I spent some time adjusting the PHP code in the tabs module but it proved complex as the 'basics' tab was set differently.
So, I ended up using jQuery to easily add the first/last classes.
You can use this snippet in your theme script.js
/* add first/last classes to fieldset tabs properly */
Drupal.behaviors.cck_fieldgroup_tabs_firstlast = function(context) {
$('ul.ui-tabs-nav', context).each(function(){
var count = 1;
var total = $(this).children('li').size();
$(this).children('li').each(function(){
//clean off the possibly inaccurate classes before adding our own
$(this).removeClass('last');
$(this).removeClass('first');
// add the first and/or last class
if( count == 1 ){
$(this).addClass('first');
}
if( count == total ){
$(this).addClass('last');
}
count++;
});
});
}
DT
P.S Thanks again, great module :)