Cet article décrit la méthode de JS pour augmenter et réduire automatiquement les tables Web. Partagez-le pour votre référence. L'analyse spécifique est la suivante:
Il s'agit d'un code d'effet de table dynamique personnalisé. Les tables de la page Web sont automatiquement agrandies ou réduites, et constamment modifiées
Il souligne principalement le rôle de l'affichage
Copiez le code comme suit: <html>
<adal>
<Title> JS Table mobile </TITME>
<Meta content = "text / html; charset = hz-gb-2312" http-equiv = contenu-type>
<Style> .cellStyle {
Couleur: #ffffff; Font-Family: Times; Taille de police: 11pt; Police-poids: Audacieux
}
UN {
Couleur: # FF0000; Text-decoration: aucun
}
A: Hover {
Couleur: text-decoration: souligner
}
</ Style>
<Script Language = JavaScript>
var i_borderColor = 0
var i_borderColorlight = 10
var i_borderColordark = 20
var v_borderColor = 1
var v_borderColorlight = 1
var v_borderColordark = 1
var textColor = new Array ()
textColor [0] = "fffff"
textColor [1] = "fff8f8"
textColor [2] = "fff0f0"
textColor [3] = "ffd8d8"
textColor [4] = "ffd0d0"
textColor [5] = "ffc8c8"
textColor [6] = "ffc0c0"
textColor [7] = "ffb8b8"
textColor [8] = "FFB0B0"
textColor [9] = "FFA8A8"
textColor [10] = "FFA0A0"
textColor [11] = "FF9898"
textColor [12] = "FF9090"
textColor [13] = "FF8888"
textColor [14] = "FF8080"
textColor [15] = "FF7878"
textColor [16] = "FF7070"
textColor [17] = "FF6868"
textColor [18] = "FF6060"
textColor [19] = "FF5858"
textColor [20] = "FF5050"
textColor [21] = "FF4848"
textColor [22] = "FF4040"
textColor [23] = "FF3838"
textColor [24] = "FF3030"
textColor [25] = "FF2828"
textColor [26] = "FF2020"
textColor [27] = "FF1818"
textColor [28] = "FF1010"
textColor [29] = "FF0808"
textColor [30] = "FF0000"
fonction CheckBrowser () {
if (document.layers) {
alerte ("Ce script nécessite Internet Explorer 4 ou plus. Désolé les gens!")
}
if (document.all) {
BorderColor ()
}
}
fonction BorderColor () {
if (i_borderColor> = textColor.length-1) {v_borderColor * = - 1}
if (i_borderColor <= 0) {v_borderColor * = - 1}
if (i_borderColordark> = textColor.length-1) {v_borderColordark * = - 1}
if (i_borderColordark <= 0) {v_borderColordark * = - 1}
if (i_borderColorlight> = textColor.length-1) {v_borderColorlight * = - 1}
if (i_borderColorlight <= 0) {v_borderColorlight * = - 1}
document.all.cellone.borderColor = textColor [i_borderColor]
document.all.cellone.borderColordark = textColor [i_borderColordark]
document.all.cellone.borderColorlight = textColor [i_borderColorlight]
document.all.cellone.border = i_borderColorlight * 2
i_bordercolor + = v_bordercolor
i_bordercolordark + = v_bordercolordark
i_borderColorlight + = v_borderColorlight
var timer = setTimeout ("borderColor ()", 100)
}
</cript>
<Meta Content = "Microsoft FrontPage 4.0" Name = Generator> </ Head>
<Body background = "" bgColor = # ffffff onload = checkBrowser ()>
<P align = centre>
<Table Border = 0 CellPadding = 6 id = Cellone Width = 540>
<Tbody>
<tr>
<Td align = classe moyenne = cellstyle>
<font color = "# 800000"> // www.vevb.com </font>
</tr> </ tbody>
</ Table>
</docy>
</html>
J'espère que cet article sera utile à la programmation JavaScript de tous.