hii friends,
i implemented slidetoggle functions using jquery
here my issue is when i click first time it's not working.second time i click it's working.
i am using this code
$("document").ready(function () {
var active = false;
if ($("#HiddenField1").val() == "block") {
$("#FiltersliderDiv").css("display", "none");
}
if ($("#HiddenField1").val() == "none") {
$("#FiltersliderDiv").css("display", "block");
$("#Filters").css('background-color', '#0082AA');
$("#MapAndChart").css('background-color', '#0082AA');
$("#Report").css('background-color', '#0082AA');
}
$("#Filters").click(function () {
if (active == false) {
$("#FiltersliderDiv").slideDown("slow");
$("#ReportsliderDiv").slideUp("slow");
$("#MapAndChartsliderDiv").slideUp("slow");
$("#MapAndChart").css('background-color', 'Gray');
$("#Filters").css('background-color', '#0082AA');
$("#Filters").css('fontcolor', '#333333');
$("#Report").css('background-color', 'Gray');
document.getElementById("MapAndChart").style.color = "black";
document.getElementById("Report").style.color = "black";
document.getElementById("Filters").style.color = "White";
active = true;
}
else {
$("#FiltersliderDiv").slideUp("slow");
$("#Filters").css('background-color', 'Gray');
document.getElementById("Filters").style.color = "black";
active = false;
}
});
});
$("document").ready(function () {
var active = false;
if ($("#HiddenField2").val() == "block") {
$("#MapAndChartsliderDiv").css("display", "none");
$("#MapAndChart").css('background-color', 'Gray');
}
if ($("#HiddenField2").val() == "none") {
$("#MapAndChartsliderDiv").css("display", "block");
}
$("#MapAndChart").click(function () {
if (active == false) {
$("#MapAndChartsliderDiv").slideDown("slow");
$("#FiltersliderDiv").slideUp("slow");
$("#ReportsliderDiv").slideUp("slow");
$("#MapAndChart").css('background-color', '#0082AA');
$("#Filters").css('background-color', 'Gray');
$("#Report").css('background-color', 'Gray');
document.getElementById("MapAndChart").style.color = "White";
document.getElementById("Report").style.color = "black";
document.getElementById("Filters").style.color = "black";
active = true;
}
else {
$("#MapAndChartsliderDiv").slideUp("slow");
$("#MapAndChart").css('background-color', 'Gray');
document.getElementById("MapAndChart").style.color = "black";
active = false;
}
});
});
$("document").ready(function () {
var active = false;
if ($("#HiddenField3").val() == "block") {
$("#ReportsliderDiv").css("display", "none");
$("#Report").css('background-color', 'Gray');
}
if ($("#HiddenField3").val() == "none") {
$("#ReportsliderDiv").css("display", "block");
}
$("#Report").click(function () {
if (active == false) {
$("#ReportsliderDiv").slideDown("slow");
$("#FiltersliderDiv").slideUp("slow");
$("#MapAndChartsliderDiv").slideUp("slow");
$("#MapAndChart").css('background-color', 'Gray');
$("#Filters").css('background-color', 'Gray');
$("#Report").css('background-color', '#0082AA');
document.getElementById("MapAndChart").style.color = "black";
document.getElementById("Report").style.color = "White";
document.getElementById("Filters").style.color = "black";
active = true;
}
else {
$("#ReportsliderDiv").slideUp("slow");
$("#Report").css('background-color', 'Gray');
document.getElementById("Report").style.color = "black";
active = false;
}
});
});
please share any idea to me.