Good morning everyone!
I'm a beginner in jQuery and Bootstrap, and I'm having some difficulty using both simultaneously.
I'm trying to generate a button that, when clicking, displays a small form for inserting email. However, it is only working when the window is in mobile size (smaller than 768px), at higher resolutions, the button is disabled and the code does not work.
Here is my short code:
[...]
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nome da Página</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<script src="js/jquery-1.11.3.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(window).load(function(){
$('#toggle-form-acesso').click(form_toggle);
$('#form-acesso').hide();
});
function form_toggle(){
$("#form-acesso").toggle('swing');
}
</script>
</head>
<body>
[...]
<div id="apresentacao" class="col-sm-8 col-sm-offset-4">
<button type="button" id="toggle-form-acesso">Cadastrar e-mail</button>
<form id="form-acesso" action="" method="post">
<label>E-mail:</label>
<input class="field-text" type="text" name="email" id="email" placeholder="[email protected]" required/>
<input class="botao-login" type="submit" value="Solicitar acesso" />
</form>
[...]
Did I do something wrong? Does anyone know what might be happening?
Thank you very much! : D