1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
use CGI;
$query = new CGI;
my $vmwaretab = $query->param("vmwaretab"); if (defined($vmwaretab) eq "") { $vmwaretab ="test"; }
my $globaltab = $query->param("globaltab"); if (defined($globaltab) eq "") { $globaltab ="test"; }
sub GlobalList
{
my $i=0;
my $active="";
print "<div class=\"tabs\">";
foreach my $k ( keys %Globaltabs )
{
$active="inactive";
if ( $k eq $globaltab ){$active="active";}
print "<a href=\"#\" data-tab=\"$i\" class=\"tab $active\">$k</a>";
$i++;
}
$i=0;
foreach my $k ( keys %Globaltabs )
{
my $v=$Globaltabs{$k};
$active="";
if ( $k eq $globaltab ){$active="active";}
print "<div data-content=\"$i\" class=\"content $active\" >
<table class='tsmd'>
$v
</table>
</div>";
$i++;
}
print "</div></table>";
#print "</tbody></table>"; #fin du tableau de présentation du fichier de log
#print "</table>"; #fin du tableau de la page (blanche)
}
my %Globaltabs=(
"GRAPH" => Printdev("GRAPH", "le texte"),
"test" => Printdev("test", "allezzzzz"),
"ola" => Printdev("ola", "3eme onglet"),
"LOG" => List("LOG"),
"dobredien" => Printdev("privet", "dobredien"),
"bonjour" => Printdev("zzzzz", "bonjour tout le monde"),
"music" => Printdev("privet", "tssss tsss tsssss")
);
#mon javascript :
$('[data-tab]').on('click', function (e) {
$(this).addClass('active').siblings('[data-tab]').removeClass('active').addClass('inactive')
$(this).siblings('[data-content=' + $(this).data('tab') + ']').addClass('active').removeClass('inactive').siblings('[data-content]').removeClass('active').addClass('inactive')
e.preventDefault()
})
$('[data-subtab]').on('click', function (e) {
$(this).addClass('active').siblings('[data-subtab]').removeClass('active').addClass('inactive')
$(this).siblings('[data-subcontent=' + $(this).data('tab') + ']').addClass('active').removeClass('inactive').siblings('[data-subcontent]').removeClass('active').addClass('inactive')
e.preventDefault()
}) |
Partager