I'm currently working with some basic jQuery functions like show and fadeIn, but for some reason they're not functioning properly. Can you point out what I might be doing wrong? The script is definitely being processed as I can see the "It works" message being displayed in the console.
Here's the script:
$(document).ready(function(){
$('#submit').on("click",function(e){
e.preventDefault();
console.log("It works");
$("#username-triangle").show('slow');
$("#username-error").fadeIn(500);
$("#password-triangle").fadeIn(500);
$("#password-error").fadeIn(500);
$("#form input").addClass("error-glow");
});
});
A snippet of the HTML:
<div class="login-form">
<div class="username-triangle" id="username-triangle"><img src="img/triangle.png"></div><!--username-triangle -->
<div class="error username-err" id="username-error">
<img src="img/error.png">
<p>Wrong Username</p>
</div><!--end error username-err -->
<div class="password-triangle" id="password-triangle"><img src="img/triangle.png"></div><!--end password-triangle -->
<div class="error password-err" id="password-error">
<img src="img/error.png">
<p>Wrong Password</p>
</div><!--end error passsword-err -->
A part of the CSS where elements have their visibility set to hidden:
.username-err
{
visibility: hidden;
position:absolute;
margin-top: 64px;
margin-left: 310px;
}
.username-triangle
{
visibility: hidden;
margin-top: 70px;
margin-left: 299px;
position: absolute;
z-index: 3;
}