I'm probably just retarded, but I can't get this to work. All I am trying to do is to do so when you press something (in this case #register), it changes a few lines of css.
I want to do this, when you press it once, it will appear, and then if you press it again, it will disappear. I wrote this, and when you first press it, it will show it, but when you press it again, it will not disappear. I just can't understand what I'm doing wrong. XD Thanks for any help you can give: P
My javascript
$(document).ready(function () {
$('#registerButton').click(function () {
if ($("#register").css("opacity") === ".9") {
$("#register").css({
"opacity": "0"
});
$("#register").css({
"height": "0px"
});
}
if ($("#register").css("opacity") === "0") {
$("#register").css({
"opacity": ".9"
});
$("#register").css({
"height": "260px"
});
}
});
});
EDIT: I'm trying to use it in such a way that I can make it look nice css animations, so I just ca toggle functionn't use it :(