What I want to achieve is to keep some of them hidden labels
either through su clase
or su ID
, what I'm trying to achieve is a accordion
dynamic landscape format.
If I click on any accordion
of it, it should hide all the tabs except the one that was selected, this is already done halfway, because when the objetos
unselected ones are hidden, the accorcdion
size changes.
This is what it looks like when HTML elements are hidden
and when I enter the system it looks like this and it should look like this in that same size.
Code to hide elements:
function ocultarInfo() {
$('#textName1').hide();
$('#textCertificate1').hide();
$('#textRFC1').hide();
$('#textType1').hide();
$('#textCountry1').hide();
$('#textState1').hide();
$('#textAdress1').hide();
$('#textCode1').hide();
$('#textPhone1').hide();
$('.textLBL1').hide();
}
Code to show the elements of the selected Accordion
function verInfo(conta) {
if (conta == 2) {
$('#txtNombre' + conta).show();
$('#txtCertificado' + conta).show();
$('#txtRFC' + conta).show();
$('#txtSistema' + conta).show();
$('#txtPais' + conta).show();
$('#txtEstado' + conta).show();
$('#txtTelefono' + conta).show();
$('#txtDireccion' + conta).show();
$('#txtCodigo' + conta).show();
setTimeout(ocultarInfo, 2000);
}
It already hides the elements from me, only that when it does, it accordion
changes size and the new elements that should be seen are not seen correctly.
Use the
visibility
css property, instead of thehide()
and methodsshow()
.The visibility property is used to determine if the boxes generated by an element are rendered.
as an example:
http://www.w3.org/wiki/CSS/Properties/visibility
You can create a function in your JavaScript to hide the elements of your html
and to Show You just have to:
You can play around with your Div in case you want to hide a region: