I have a Element (nav) that gets hidden or shown, when another element (#aNav) gets clicked.
That already runs fine.
But now i want, that the clicked element (#aNav), itself, gets some changed styles. These styles shall also be changed, wether the (nav) element is shown or not. On another click, the else section is not performed.
Here is the code:
function nav(){
$('#aNav').click(function() {
//changes the value of left
var $lefter = $("nav");
$lefter.animate({
left: parseInt($lefter.css('left'),10) == 0 ?
-$lefter.outerWidth() :
0
});
left = $("nav").css("left");
if( left == 0 ) {
$("#aNav div").css({
"border-right":"33px solid transparent",
"border-left":"0 solid transparent"
});
} else {
$("#aNav div").css({
"border-left":"33px solid transparent",
"border-right":"0 solid transparent"
});
}
});
};
$(document).ready(function(){
nav();
});
I only want the else section to be executed. Maybe someone can help.