if you add the parent div class into the data attributes:
<button id="egyes" class="btn btn-danger" data-parentclass="progress-danger">Hide</button> some text
<button id="kettes" class="btn btn-warning" data-parentclass="progress-warning">Hide</button> other text
<button id="harmas" class="btn btn-info" data-parentclass="progress-info">Hide</button> some more text
<button id="otos" class="btn btn-success" data-parentclass="progress-success">Hide</button> last button
<button id="showall" class="btn">Show all</button>
or add it in via javascript:
$("#egyes").data("parentclass", progress"progress-dangerdanger");
// etc
then the javascript can work it out itself.
$(document).ready(function() {
$("#egyes, #kettes, #harmas, #otos").click( function() {
var $parent = $("div." $(this).data("parentclass")).parent();
if ($parent.is(":visible")) {
$(this).html("Hide");
} else {
$(this).html("Show");
}
parent.fadeToggle();
});
$("#showall").click( function() {
$("div.container > div > div.progress").parent().fadeIn();
});
});
if you add the parent div class into the data attributes:
<button id="egyes" class="btn btn-danger" data-parentclass="progress-danger">Hide</button> some text
<button id="kettes" class="btn btn-warning" data-parentclass="progress-warning">Hide</button> other text
<button id="harmas" class="btn btn-info" data-parentclass="progress-info">Hide</button> some more text
<button id="otos" class="btn btn-success" data-parentclass="progress-success">Hide</button> last button
<button id="showall" class="btn">Show all</button>
or add it in via javascript:
$("#egyes").data("parentclass", progress-danger);
// etc
then the javascript can work it out itself.
$(document).ready(function() {
$("#egyes, #kettes, #harmas, #otos").click( function() {
var $parent = $("div." $(this).data("parentclass")).parent();
if ($parent.is(":visible")) {
$(this).html("Hide");
} else {
$(this).html("Show");
}
parent.fadeToggle();
});
$("#showall").click( function() {
$("div.container > div > div.progress").parent().fadeIn();
});
});
if you add the parent div class into the data attributes:
<button id="egyes" class="btn btn-danger" data-parentclass="progress-danger">Hide</button> some text
<button id="kettes" class="btn btn-warning" data-parentclass="progress-warning">Hide</button> other text
<button id="harmas" class="btn btn-info" data-parentclass="progress-info">Hide</button> some more text
<button id="otos" class="btn btn-success" data-parentclass="progress-success">Hide</button> last button
<button id="showall" class="btn">Show all</button>
or add it in via javascript:
$("#egyes").data("parentclass", "progress-danger");
// etc
then the javascript can work it out itself.
$(document).ready(function() {
$("#egyes, #kettes, #harmas, #otos").click( function() {
var $parent = $("div." $(this).data("parentclass")).parent();
if ($parent.is(":visible")) {
$(this).html("Hide");
} else {
$(this).html("Show");
}
parent.fadeToggle();
});
$("#showall").click( function() {
$("div.container > div > div.progress").parent().fadeIn();
});
});
if you add the parent div class into the data attributes:
<button id="egyes" class="btn btn-danger" data-parentclass="progress-danger">Hide</button> some text
<button id="kettes" class="btn btn-warning" data-parentclass="progress-warning">Hide</button> other text
<button id="harmas" class="btn btn-info" data-parentclass="progress-info">Hide</button> some more text
<button id="otos" class="btn btn-success" data-parentclass="progress-success">Hide</button> last button
<button id="showall" class="btn">Show all</button>
or add it in via javascript:
$("#egyes").data("parentclass", progress-danger);
// etc
then the javascript can work it out itself.
$(document).ready(function() {
$("#egyes, #kettes, #harmas, #otos").click( function() {
var $parent = $("div." $(this).data("parentclass")).parent()
.fadeToggle();
if ($parent.is(":visible")) {
$(this).html("Hide");
} else {
$(this).html("Show");
}
parent.fadeToggle();
});
$("#showall").click( function() {
$("div.container > div > div.progress").parent().fadeIn();
});
});
if you add the parent div class into the data attributes:
<button id="egyes" class="btn btn-danger" data-parentclass="progress-danger">Hide</button> some text
<button id="kettes" class="btn btn-warning" data-parentclass="progress-warning">Hide</button> other text
<button id="harmas" class="btn btn-info" data-parentclass="progress-info">Hide</button> some more text
<button id="otos" class="btn btn-success" data-parentclass="progress-success">Hide</button> last button
<button id="showall" class="btn">Show all</button>
or add it in via javascript:
$("#egyes").data("parentclass", progress-danger);
// etc
then the javascript can work it out itself.
$(document).ready(function() {
$("#egyes, #kettes, #harmas, #otos").click( function() {
var $parent = $("div." $(this).data("parentclass")).parent()
.fadeToggle();
if ($parent.is(":visible")) {
$(this).html("Hide");
} else {
$(this).html("Show");
}
});
$("#showall").click( function() {
$("div.container > div > div.progress").parent().fadeIn();
});
});
if you add the parent div class into the data attributes:
<button id="egyes" class="btn btn-danger" data-parentclass="progress-danger">Hide</button> some text
<button id="kettes" class="btn btn-warning" data-parentclass="progress-warning">Hide</button> other text
<button id="harmas" class="btn btn-info" data-parentclass="progress-info">Hide</button> some more text
<button id="otos" class="btn btn-success" data-parentclass="progress-success">Hide</button> last button
<button id="showall" class="btn">Show all</button>
or add it in via javascript:
$("#egyes").data("parentclass", progress-danger);
// etc
then the javascript can work it out itself.
$(document).ready(function() {
$("#egyes, #kettes, #harmas, #otos").click( function() {
var $parent = $("div." $(this).data("parentclass")).parent();
if ($parent.is(":visible")) {
$(this).html("Hide");
} else {
$(this).html("Show");
}
parent.fadeToggle();
});
$("#showall").click( function() {
$("div.container > div > div.progress").parent().fadeIn();
});
});
if you add the parent div class into the data attributes:
<button id="egyes" class="btn btn-danger" data-parentclass="progress-danger">Hide</button> some text
<button id="kettes" class="btn btn-warning" data-parentclass="progress-warning">Hide</button> other text
<button id="harmas" class="btn btn-info" data-parentclass="progress-info">Hide</button> some more text
<button id="otos" class="btn btn-success" data-parentclass="progress-success">Hide</button> last button
<button id="showall" class="btn">Show all</button>
or add it in via javascript:
$("#egyes").data("parentclass", progress-danger);
// etc
then the javascript can work it out itself.
$(document).ready(function() {
$("#egyes, #kettes, #harmas, #otos").click( function() {
var $parent = $("div." $(this).data("parentclass"))
.parent()
.fadeToggle();
if ($parent.is(":visible")) {
$(this).html("Hide");
} else {
$(this).html("Show");
}
});
$("#showall").click( function() {
$("div.container > div > div.progress").parent().fadeIn();
});
});