Js achieves the effect of imitating Windows style tabs and buttons

Source: Internet
Author: User

Js achieves the effect of imitating Windows style tabs and buttons

This article describes how js achieves the effect of imitating Windows style tabs and buttons. Share it with you for your reference. The specific implementation method is as follows:

?

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

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

<Html>

<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>

<Head>

<Style type = "text/css">

<! --

Body {

Font-family: 'Ms Shell dlg',, Tahoma;

Font-size: 12px;

Background-color: #336699;

Color: #000000;

}

Td, div, input, textarea {

Font-family: 'Ms Shell dlg',, Tahoma;

Font-size: 12px;

Cursor: default;

}

. Title {

Background-color: #000080;

Color: # fdf7d3;

Padding: 1;

Font-family:;

Font-size: 12px;

}

. Up {

Background-color: # cccccc;

Color: #000000;

Border: 2px outset # ffffff

}

. Down {

Background-color: # cccccc;

Border: 2px inset # ffffff

}

. Up1 {

Background-color: # cccccc;

Color: #000000;

Border: 1px outset # ffffff

}

. Down1 {

Background-color: # cccccc;

Border: 1px inset # ffffff

}

. L {

Background-color: # cccccc;

Height: 18px;

Border-left: 2px outset # ffffff;

Border-right: 2px outset # ffffff;

Color: #000000;

Border-top: 2px outset # ffffff;

Padding-top: 2;

Height: 18

}

. Lc {

Background-color: # cccccc;

Height: 18px;

Border-left: 2px outset # ffffff;

Border-right: 2px outset # ffffff;

Color: #000000;

Border-top: 2px outset # ffffff;

Padding-top: 2;

Height: 20

}

. L-h {

Background-color: # cccccc;

Border-left: 2px outset # ffffff;

Border-top: 2px outset # ffffff;

Color: #000000;

}

. L-c {

Background-color: # cccccc;

Border-top: 2px outset # ffffff

}

. L-r {

Background-color: # cccccc;

Border-right: 2px outset # ffffff;

Border-top: 2px outset # ffffff;

Color: #000000;

}

. L-hc {

Background-color: # cccccc;

Border-left: 2px outset # ffffff;

Color: #000000;

}

. L-cc {

Background-color: # cccccc;

Color: #000000;

}

. L-rc {

Background-color: # cccccc;

Border-right: 2px outset # ffffff;

Color: #000000;

}

Td {

Color: #000000;

}

-->

</Style>

<Title> display attributes </title>

<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">

<Body style = "border: outset 1 # ffffff; margin: 0; background-color: # cccccc; padding: 3px" scroll = no>

<Script language = "JavaScript">

<! --

Function restore ()

{

Td1.className = "l ";

Td2.className = "l ";

Td3.className = "l ";

Td4.className = "l ";

Td5.className = "l ";

Td6.className = "l ";

Td_1.className = "l-h ";

Td_2.className = "l-c ";

Td_3.className = "l-c ";

Td_4.className = "l-c ";

Td_5.className = "l-c ";

Td_6.className = "l-c ";

W1.style. display = "none ";

W2.style. display = "none ";

W3.style. display = "none ";

W4.style. display = "none ";

W5.style. display = "none ";

W6.style. display = "none ";

}

Function c1 ()

{

Td1.className = "lc ";

Td_1.className = "l-hc ";

W1.style. display = "block ";

}

Function c2 ()

{

Td2.className = "lc ";

Td_2.className = "l-cc ";

W2.style. display = "block ";

}

Function c3 ()

{

Td3.className = "lc ";

Td_3.className = "l-cc ";

W3.style. display = "block ";

}

Function c4 ()

{

Td4.className = "lc ";

Td_4.className = "l-cc ";

W4.style. display = "block ";

}

Function c5 ()

{

Td5.className = "lc ";

Td_5.className = "l-cc ";

W5.style. display = "block ";

}

Function c6 ()

{

Td6.className = "lc ";

Td_6.className = "l-cc ";

W6.style. display = "block ";

}

// -->

</SCRIPT>

<Form name = "free" method = "post" target = "_ target">

<Div align = "center">

<Center>

<Table border = "0" cellpadding = "0" cellspacing = "0" width = "400" height = "61">

<Tr>

<Td width = "50" height = "20" align = "center"

Valign = "bottom" onclick = restore (); c1 ();>

<Div id = "td1" class = "lc"> background </div> </td>

<Td width = "50" height = "20" align = "center"

Valign = "bottom" onclick = restore (); c2 ();>

<Div id = "td2" class = "l"> screensaver </div> </td>

<Td width = "50" height = "20" align = "center"

Valign = "bottom" onclick = restore (); c3 ();>

<Div id = "td3" class = "l"> appearance </div> </td>

<Td width = "50" height = "20" align = "center"

Valign = "bottom" onclick = restore (); c4 ();>

<Div id = "td4" class = "l"> Web </div> </td>

<Td width = "50" height = "20" align = "center"

Valign = "bottom" onclick = restore (); c5 ();>

<Div id = "td5" class = "l"> effect </div> </td>

<Td width = "50" height = "20" align = "center"

Valign = "bottom" onclick = restore (); c6 ();>

<Div id = "td6" class = "l"> Settings </div> </td>

<Td width = "50" height = "20" align = "center" valign = "bottom"> </td>

<Td width = "50" height = "20" align = "center" valign = "bottom"> </td>

</Tr>

<Tr style = "">

<Td width = "50" height = "1" align = "center" class = "l-hc" id = "td_1"> </td>

<Td width = "50" height = "1" align = "center" class = "l-c" id = "td_2"> </td>

<Td width = "50" height = "1" align = "center" class = "l-c" id = "td_3"> </td>

<Td width = "50" height = "1" align = "center" class = "l-c" id = "td_4"> </td>

<Td width = "50" height = "1" align = "center" class = "l-c" id = "td_5"> </td>

<Td width = "50" height = "1" align = "center" class = "l-c" id = "td_6"> </td>

<Td width = "50" height = "1" align = "center" class = "l-c" id = "td _"> </td>

<Td width = "50" height = "1" align = "center" class = "l-r" id = "td _"> </td>

</Tr>

<Tr>

<Td width = "398" height = "360" class = "up" colspan = "8"

Style = "border-top-style: solid; border-top-width: 0; padding: 5">

<P align = "center">

<Div align = "center">

<Table border = "0" cellpadding = "0" cellspacing = "0"

Width = "100%" height = "325">

<Tr>

<Td width = "100%" height = "280">

<Div align = "center">

<Center>

<Div style = "display:" id = w1>

<Div style = "display: none" id = w2>

<Div style = "display: none" id = w3>

<Div style = "display: none" id = w4>

<Div style = "display: none" id = w5>

<Div style = "display: none" id = w6>

</Center>

</Div>

</Td>

</Tr>

</Table>

</Div>

</Td>

</Tr>

</Center>

<Tr>

<Td width = "398" height = "37" colspan = "8"

Style = "border-top-style: solid; border-top-width: 0; padding: 5">

<P align = "right"> <input type = "button" value = "OK" name = "_ OK"

Style = "width: 60; height: 22" class = "up">

<Input type = "button" value = "cancel" name = "_ cancel"

Style = "width: 60; height: 22" class = "up" onclick = "window. close ();">

<Input type = "button" value = "application (A)" name = "_ apply"

Style = "width: 60; height: 22" disabled class = "up">

</Td>

</Tr>

</Table>

</Div>

</Form>

</Body>

</Html>

The running effect is as follows:

I hope this article will help you design javascript programs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.