Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
mini-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 82b24349
authored
2019-11-26 11:09:12 -0300
by
Georgina Mondino
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Creacion de botones y mostrar primer tab en borrador
1 parent
2d770d02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
32 deletions
Geo/Borrador.html
Geo/Borrador.html
View file @
82b2434
...
...
@@ -3,10 +3,12 @@
<body>
<input
type=
"number"
id=
"CantBotones"
>
<input
type=
"number"
id=
"CantBotones"
>
<button
onclick=
"AgregarTabs()"
>
Generar Tabs
</button>
<section
id=
"BotonesContainer"
>
<section
id=
"BotonesContainer"
>
</section>
<section
id=
"TabsContainer"
>
</section>
</body>
...
...
@@ -16,44 +18,75 @@
let
m
=
document
.
getElementById
(
"CantBotones"
).
value
;
let
n
;
for
(
n
=
0
;
n
<
m
;
n
++
)
{
let
padre
=
document
.
getElementById
(
"BotonesContainer"
);
let
padreBotones
=
document
.
getElementById
(
"BotonesContainer"
);
let
padreTabs
=
document
.
getElementById
(
"TabsContainer"
);
let
boton
=
document
.
createElement
(
"Button"
);
padre
.
appendChild
(
boton
);
padreBotones
.
appendChild
(
boton
);
boton
.
setAttribute
(
"id"
,
"Boton"
+
n
);
boton
.
setAttribute
(
"value"
,
n
);
boton
.
setAttribute
(
"class"
,
"Botones"
);
boton
.
addEventListener
(
"click"
,
HabilitarTab
);
boton
.
style
.
width
=
((
100
-
(
0.2
*
m
))
/
m
)
+
"%"
;
let
ancho
=
((
100
-
(
0.2
*
m
))
/
m
)
+
"%"
;
boton
.
style
.
width
=
ancho
;
let
tab
=
document
.
createElement
(
"div"
);
padreTabs
.
appendChild
(
tab
);
tab
.
style
.
width
=
ancho
*
m
;
tab
.
setAttribute
(
"id"
,
"Tab"
+
n
);
tab
.
setAttribute
(
"class"
,
"Tabs"
);
}
document
.
getElementById
(
"Tab0"
).
style
.
display
=
"block"
;
}
function
HabilitarTab
(){
function
HabilitarTab
()
{
for
(
n
=
0
;
n
<
m
;
n
++
)
{
document
.
getElementById
(
"Tab"
+
n
).
style
.
display
=
"none"
if
(
doc
){}
}
}
</script>
<style>
#BotonesContainer
{
width
:
100%
;
height
:
95%
;
}
.Botones
{
border-radius
:
5px
5px
0px
0px
;
background-color
:
grey
;
border
:
none
;
height
:
5%
;
margin
:
0.1%
;
}
.Botones
:active
{
background-color
:
whitesmoke
;
border-bottom
:
none
;
height
:
6%
;
border
:
1px
solid
rgb
(
189
,
189
,
189
);
border-bottom
:
none
;
}
.Botones
:hover
{
background-color
:
rgb
(
53
,
53
,
53
),
0.5
;
}
</style>
html
{
--Color
:
rgb
(
122
,
230
,
163
);
}
#BotonesContainer
{
width
:
100%
;
height
:
5%
;
}
#TabsContainer
{
width
:
100%
;
height
:
95%
;
}
.Botones
{
border-radius
:
5px
5px
0px
0px
;
background-color
:
rgb
(
168
,
168
,
168
);
border
:
none
;
height
:
100%
;
margin
:
0.1%
;
}
.Botones
:active
{
background-color
:
var
(
--Color
);
border-bottom
:
none
;
height
:
6%
;
border-bottom
:
none
;
}
.Botones
:hover
{
background-color
:
rgb
(
53
,
53
,
53
),
0.5
;
}
.Tabs
{
display
:
none
;
height
:
100%
;
border
:
3px
solid
var
(
--Color
);
}
</style>
</html>
\ No newline at end of file
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment