| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<!-- |
| 4 |
Copyright 2010 The Closure Library Authors. All Rights Reserved. |
| 5 |
|
| 6 |
Use of this source code is governed by the Apache License, Version 2.0. |
| 7 |
See the COPYING file for details. |
| 8 |
--> |
| 9 |
<head> |
| 10 |
<title>goog.ui.TabPane</title> |
| 11 |
<meta charset="utf-8"> |
| 12 |
<script src="../base.js"></script> |
| 13 |
<script> |
| 14 |
goog.require('goog.ui.TabPane'); |
| 15 |
</script> |
| 16 |
<link rel="stylesheet" href="css/demo.css"> |
| 17 |
<style> |
| 18 |
.goog-tabpane { |
| 19 |
background: threedface; |
| 20 |
padding-left: 1px; |
| 21 |
position: relative; |
| 22 |
} |
| 23 |
|
| 24 |
.goog-tabpane-tabs { |
| 25 |
list-style: none; |
| 26 |
margin: 0px; |
| 27 |
padding: 0px; |
| 28 |
height: 1ex; |
| 29 |
position: relative; |
| 30 |
} |
| 31 |
|
| 32 |
.goog-tabpane-left .goog-tabpane-tabs { |
| 33 |
float: left; |
| 34 |
} |
| 35 |
|
| 36 |
.goog-tabpane-right .goog-tabpane-tabs { |
| 37 |
float: right; |
| 38 |
} |
| 39 |
|
| 40 |
.goog-tabpane-cont { |
| 41 |
overflow: auto; |
| 42 |
background: threedface; |
| 43 |
border: 1px solid; |
| 44 |
border-color: threedhighlight threedshadow threedshadow threedhighlight; |
| 45 |
padding: 2px; |
| 46 |
height: 200px; |
| 47 |
} |
| 48 |
|
| 49 |
.goog-tabpane-tab, .goog-tabpane-tab-selected { |
| 50 |
display: block; |
| 51 |
padding: 0px 3ex; |
| 52 |
background: threedface; |
| 53 |
border: 1px solid; |
| 54 |
margin: 0px; |
| 55 |
} |
| 56 |
|
| 57 |
.goog-tabpane-top .goog-tabpane-tab, |
| 58 |
.goog-tabpane-top .goog-tabpane-tab-selected, |
| 59 |
.goog-tabpane-bottom .goog-tabpane-tab, |
| 60 |
.goog-tabpane-bottom .goog-tabpane-tab-selected { |
| 61 |
float: left; |
| 62 |
} |
| 63 |
|
| 64 |
.goog-tabpane-top .goog-tabpane-tab, |
| 65 |
.goog-tabpane-top .goog-tabpane-tab-selected { |
| 66 |
border-color: threedhighlight threedshadow threedface threedhighlight; |
| 67 |
} |
| 68 |
|
| 69 |
.goog-tabpane-bottom .goog-tabpane-tab, |
| 70 |
.goog-tabpane-bottom .goog-tabpane-tab-selected { |
| 71 |
border-color: threedface threedshadow threedshadow threedhighlight; |
| 72 |
} |
| 73 |
|
| 74 |
.goog-tabpane-left .goog-tabpane-tab, |
| 75 |
.goog-tabpane-left .goog-tabpane-tab-selected { |
| 76 |
border-color: threedhighlight threedface threedshadow threedhighlight; |
| 77 |
} |
| 78 |
|
| 79 |
.goog-tabpane-right .goog-tabpane-tab, |
| 80 |
.goog-tabpane-right .goog-tabpane-tab-selected { |
| 81 |
border-color: threedhighlight threedshadow threedshadow threedface; |
| 82 |
} |
| 83 |
|
| 84 |
.goog-tabpane-top .goog-tabpane-tab { |
| 85 |
margin-top: 3px; |
| 86 |
} |
| 87 |
|
| 88 |
.goog-tabpane-tab-selected { |
| 89 |
font-weight: bold; |
| 90 |
} |
| 91 |
|
| 92 |
.goog-tabpane-tab-selected, |
| 93 |
.goog-tabpane-tab-selected { |
| 94 |
padding-bottom: 2px; |
| 95 |
padding-top: 2px; |
| 96 |
} |
| 97 |
|
| 98 |
.goog-tabpane-top .goog-tabpane-tab-selected { |
| 99 |
position: relative; |
| 100 |
top: 1px; |
| 101 |
} |
| 102 |
|
| 103 |
.goog-tabpane-bottom .goog-tabpane-tab-selected { |
| 104 |
position: relative; |
| 105 |
top: -1px; |
| 106 |
} |
| 107 |
|
| 108 |
.goog-tabpane-left .goog-tabpane-tab-selected { |
| 109 |
position: relative; |
| 110 |
left: 1px; |
| 111 |
} |
| 112 |
|
| 113 |
.goog-tabpane-right .goog-tabpane-tab-selected { |
| 114 |
position: relative; |
| 115 |
left: -1px; |
| 116 |
} |
| 117 |
|
| 118 |
#tabpane2 .goog-tabpane-tab { |
| 119 |
margin-top: 0px; |
| 120 |
} |
| 121 |
|
| 122 |
p { |
| 123 |
margin-top: 0px; |
| 124 |
} |
| 125 |
|
| 126 |
</style> |
| 127 |
</head> |
| 128 |
<body> |
| 129 |
<h1>goog.ui.TabPane</h1> |
| 130 |
|
| 131 |
<div id="tabpane1"></div> |
| 132 |
<strong id="tabpane1index"></strong> selected in tab pane 1.<br/><br/> |
| 133 |
|
| 134 |
<h3>Bottom tabs</h3> |
| 135 |
<div id="tabpane2"> |
| 136 |
<div> |
| 137 |
<h2>Initial page</h2> |
| 138 |
<p> |
| 139 |
Page created automatically from tab pane child node. |
| 140 |
</p> |
| 141 |
</div> |
| 142 |
</div> |
| 143 |
|
| 144 |
<h3>Left tabs</h3> |
| 145 |
<div id="tabpane3"> |
| 146 |
<div> |
| 147 |
<h2>Front page!</h2> |
| 148 |
<p> |
| 149 |
Page created automatically from tab pane child node. |
| 150 |
</p> |
| 151 |
</div> |
| 152 |
</div> |
| 153 |
|
| 154 |
<h3>Right tabs</h3> |
| 155 |
<div id="tabpane4"> |
| 156 |
<div> |
| 157 |
<h2>Right 1</h2> |
| 158 |
<p> |
| 159 |
Page created automatically from tab pane child node. |
| 160 |
</p> |
| 161 |
</div> |
| 162 |
<div> |
| 163 |
<h2>Right 2</h2> |
| 164 |
<p> |
| 165 |
So was this page. |
| 166 |
</p> |
| 167 |
</div> |
| 168 |
</div> |
| 169 |
|
| 170 |
<div id="page1"> |
| 171 |
<h2>Page 1</h2> |
| 172 |
<p> |
| 173 |
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ac augue sed |
| 174 |
massa placerat iaculis. Aliquam tempor dictum massa. Quisque vehicula justo |
| 175 |
ut tellus. Integer urna. Aliquam libero justo, ornare at, pretium ac, |
| 176 |
vulputate quis, ante. Sed arcu. Etiam sit amet turpis. Maecenas pede. Sed |
| 177 |
turpis. Sed ultricies commodo nisl. Morbi eget magna quis nisi euismod |
| 178 |
porttitor. Vivamus lacinia massa et sem. Donec consequat ligula sed tellus. |
| 179 |
Suspendisse enim sapien, vestibulum nec, eleifend id, placerat sit amet, |
| 180 |
risus. Mauris in pede ac lorem varius facilisis. Donec dui. Nam mollis nisi |
| 181 |
eu neque. Cras luctus nisl at sapien. Ut eleifend, odio id luctus |
| 182 |
pellentesque, lorem diam dictum velit, ac gravida lectus magna vel velit. |
| 183 |
</p> |
| 184 |
<p> |
| 185 |
Etiam tempus, ante semper iaculis ultrices, ligula eros lobortis tellus, sit |
| 186 |
amet luctus dolor nisl sit amet dolor. Donec in velit. Vivamus facilisis. |
| 187 |
Proin nisi felis, commodo ut, porta dignissim, vestibulum quis, ligula. Ut |
| 188 |
egestas porttitor tortor. Ut porttitor diam a est. Sed placerat. Aliquam |
| 189 |
luctus est a risus. Aenean blandit nibh et justo. Phasellus vel lectus ut |
| 190 |
leo dictum consequat. Nam tincidunt facilisis nulla. Nunc nonummy tempus |
| 191 |
quam. Aliquam id enim. Sed rhoncus cursus lorem. Curabitur ultricies, enim |
| 192 |
quis eleifend mattis, est velit dapibus dolor, quis laoreet arcu tortor |
| 193 |
volutpat tortor. Pellentesque habitant morbi tristique senectus et netus et |
| 194 |
malesuada fames ac turpis egestas. Curabitur nec mauris et purus aliquam |
| 195 |
mattis. Cras rhoncus posuere sapien. Class aptent taciti sociosqu ad litora |
| 196 |
torquent per conubia nostra, per inceptos hymenaeos. |
| 197 |
</p> |
| 198 |
<p> |
| 199 |
Mauris lacinia ornare nunc. Donec molestie. Sed nulla libero, tincidunt vel, |
| 200 |
porta sit amet, nonummy eget, augue. Class aptent taciti sociosqu ad litora |
| 201 |
torquent per conubia nostra, per inceptos hymenaeos. Donec ac risus. Cras |
| 202 |
euismod congue orci. Mauris mattis, ipsum at vestibulum bibendum, odio est |
| 203 |
rhoncus nisi, vel aliquam ante velit quis neque. Duis nonummy tortor id |
| 204 |
ante. Aenean auctor odio non nulla. Fusce hendrerit, mi et fringilla |
| 205 |
venenatis, sem ipsum fermentum lorem, vel posuere urna eros eget massa. |
| 206 |
</p> |
| 207 |
<p> |
| 208 |
Nulla nec sapien eget mauris pretium tempor. Phasellus scelerisque quam id |
| 209 |
mauris. Cras erat ante, pretium ut, vestibulum ac, tincidunt ut, nunc. |
| 210 |
Vivamus velit sapien, feugiat ac, elementum ac, viverra non, leo. Phasellus |
| 211 |
imperdiet, magna at placerat consectetuer, enim urna aliquam augue, nec |
| 212 |
tincidunt justo lectus nec lectus. Nam neque. Nullam ullamcorper euismod |
| 213 |
augue. Maecenas arcu purus, sollicitudin nec, consequat a, gravida quis, |
| 214 |
massa. Nullam bibendum viverra risus. Sed nibh. Morbi dapibus pellentesque |
| 215 |
erat. |
| 216 |
</p> |
| 217 |
<p> |
| 218 |
Cras non tellus. Maecenas nulla est, tincidunt sed, porta sit amet, placerat |
| 219 |
sed, diam. Morbi pulvinar. Vestibulum ante ipsum primis in faucibus orci |
| 220 |
luctus et ultrices posuere cubilia Curae; Praesent felis lacus, pretium at, |
| 221 |
egestas sed, fermentum at, est. Pellentesque sagittis feugiat orci. Nam |
| 222 |
augue. Sed eget dolor. Proin vitae metus scelerisque massa fermentum tempus. |
| 223 |
Nulla facilisi. Pellentesque habitant morbi tristique senectus et netus et |
| 224 |
malesuada fames ac turpis egestas. Aenean eleifend, leo gravida mollis |
| 225 |
tempor, tellus ipsum porttitor leo, eget condimentum tellus neque sit amet |
| 226 |
orci. Sed non lectus. Suspendisse nonummy purus ac massa. Sed quis elit |
| 227 |
dapibus nunc semper porta. Maecenas risus eros, euismod quis, sagittis eget, |
| 228 |
aliquet eget, dui. Donec vel nibh. Vivamus nunc purus, euismod in, feugiat |
| 229 |
in, sodales vitae, nunc. Nulla lobortis. |
| 230 |
</p> |
| 231 |
</div> |
| 232 |
|
| 233 |
<div id="page2"> |
| 234 |
<p> |
| 235 |
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et nisi id |
| 236 |
lorem tempor semper. Suspendisse ante. Integer ligula urna, venenatis quis, |
| 237 |
placerat vitae, commodo quis, sapien. Quisque nec lectus. Sed non dolor. Sed |
| 238 |
congue, nisi in pharetra consequat, odio diam pulvinar arcu, in laoreet elit |
| 239 |
risus id ipsum. Class aptent taciti sociosqu ad litora torquent per conubia |
| 240 |
nostra, per inceptos hymenaeos. Praesent tellus enim, imperdiet a, sagittis |
| 241 |
id, pulvinar vel, tortor. Integer nulla. Sed nulla augue, lacinia id, |
| 242 |
vulputate eu, rhoncus non, ante. Integer lobortis eros vitae quam. Phasellus |
| 243 |
sagittis, ipsum sollicitudin bibendum laoreet, arcu erat luctus lacus, vel |
| 244 |
pharetra felis metus tincidunt diam. Cras ac augue in enim ultricies |
| 245 |
aliquam. |
| 246 |
</p> |
| 247 |
<input type="text" /> |
| 248 |
<select><option>Select box</option></select> |
| 249 |
<button>Button</button> |
| 250 |
</div> |
| 251 |
|
| 252 |
<div id="page5"> |
| 253 |
<h2>Page 5</h2> |
| 254 |
<p> |
| 255 |
This is page 5. |
| 256 |
</p> |
| 257 |
</div> |
| 258 |
|
| 259 |
<script> |
| 260 |
|
| 261 |
var tabPane = new goog.ui.TabPane(document.getElementById('tabpane1')); |
| 262 |
tabPane.addPage(new goog.ui.TabPane.TabPage( |
| 263 |
document.getElementById('page1'))); |
| 264 |
tabPane.addPage(new goog.ui.TabPane.TabPage( |
| 265 |
document.getElementById('page2'), 'Page 2')); |
| 266 |
tabPane.addPage(new goog.ui.TabPane.TabPage(null, 'Page 3')); |
| 267 |
tabPane.addPage(new goog.ui.TabPane.TabPage('Page 5')); |
| 268 |
tabPane.addPage(new goog.ui.TabPane.TabPage('Page 4'), 3); |
| 269 |
|
| 270 |
var pg5 = new goog.ui.TabPane.TabPage(document.getElementById('page5')) |
| 271 |
tabPane.addPage(pg5); |
| 272 |
tabPane.addPage(new goog.ui.TabPane.TabPage('Page 6')); |
| 273 |
tabPane.removePage(pg5); |
| 274 |
tabPane.removePage(2); |
| 275 |
|
| 276 |
function tabChanged(event) { |
| 277 |
goog.dom.setTextContent(document.getElementById('tabpane1index'), |
| 278 |
event.page.getTitle()); |
| 279 |
} |
| 280 |
goog.events.listen(tabPane, goog.ui.TabPane.Events.CHANGE, tabChanged); |
| 281 |
|
| 282 |
tabPane.setSelectedIndex(1); |
| 283 |
|
| 284 |
|
| 285 |
var tabPane2 = new goog.ui.TabPane(document.getElementById('tabpane2'), |
| 286 |
goog.ui.TabPane.TabLocation.BOTTOM); |
| 287 |
tabPane2.addPage(new goog.ui.TabPane.TabPage('Page 7')); |
| 288 |
tabPane2.addPage(pg5); |
| 289 |
|
| 290 |
pg5.select(); |
| 291 |
pg5.setTitle('Renamed Page'); |
| 292 |
|
| 293 |
var tabPane3 = new goog.ui.TabPane(document.getElementById('tabpane3'), |
| 294 |
goog.ui.TabPane.TabLocation.LEFT); |
| 295 |
tabPane3.addPage(new goog.ui.TabPane.TabPage('Page 7')); |
| 296 |
|
| 297 |
var tabPane4 = new goog.ui.TabPane(document.getElementById('tabpane4'), |
| 298 |
goog.ui.TabPane.TabLocation.RIGHT); |
| 299 |
tabPane4.addPage(new goog.ui.TabPane.TabPage('Page 99')); |
| 300 |
</script> |
| 301 |
</body> |
| 302 |
</html> |