I am working on an application and have the following jquery code in included .js file
function b(){}
b.prototype.expand=function(w){
w.preventDefault();
$(".sidebar-container").removeClass("sidebar-collapsed");
$(".sidebar-collapse").show();
$(".sidebar h2").show();
$(".sidebar ul").show();
$(".sidebar-expand").hide()
};
b.prototype.collapse=function(w){
w.preventDefault();
$(".sidebar-container").addClass("sidebar-collapsed");
$(".sidebar-expand").show();$(".sidebar h2").hide();
$(".sidebar ul").hide();
$(".sidebar-collapse").hide()
};
b.prototype.listen=function(){
$(document).on("click",".sidebar-collapse",this.collapse);
$(document).on("click",".sidebar-expand",this.expand)
};
By Default the side panel is in expand condition and this code works fine for clicks but I have spent over 2 hours to make it to collapse by its By Default condition but no luck!
I am new to javascript and followed different methods by searching google and stackoverflow but no luck! Any help would be much appreciated, Thanks in advance.
$(document).ready();? Hard to say unless you postcollapseandexpandmethods...