Hello, I'm using JQuery to show / hide the divs. When I open the local page the divs work normally (open and hide), but when uploading the page to the web (hosting), the divs no longer work. I already looked at the preview and is not showing any errors. My question is, what could be causing this error? And if possible, help me with a more functional way of doing this? Thanks in advance.
This is the code I'm using:
<!DOCTYPE html>
<html>
<head>
<meta charset = "utf-8">
<meta name = "viewport" content = "width:device-width, initial-scale=1">
<title>Mostrar/Ocultar</title>
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script><scriptsrc='lib/bootstrap/js/bootstrap.min.js'></script><linkrel="stylesheet" type="text/css" href="lib/css/estilo.css">
</head>
<body>
<div class = "Menu-Lateral">
<div class = "container">
<div class = "row">
<nav class = "menu">
<ul>
<li><a href="#" class = "conteudoDiv" data-element = "#carimbo"><i class = "fa fa-certificate"></i>Solicitar Carimbo</a></li>
<li><a href="#" class = "conteudoDiv" data-element = "#auditorio"><i class = "fa fa-tty"></i>Portaria</a></li>
</ul>
</nav>
</div>
</div>
</div>
<div id = "carimbo" class = "row">
<h1>Carimbo</h1>
</div>
<div id = "auditorio" class = "row">
<h1>Auditorio</h1>
</div>
</body>
</html>
CSS:
#carimbo
{
text-align: center;
width: 100%;
margin: 0 auto;
display: none;
}
#auditorio
{
text-align: center;
width: 100%;
margin: 0 auto;
display: none;
}
JQuery:
<script type="text/javascript">
function ocultar()
{
document.getElementById('carimbo').style.display = 'none';
document.getElementById('auditorio').style.display = 'none';
}
</script>
<!-- Controle das divs !-->
<script type="text/javascript">
jQuery(document).ready(function($)
{
$('.conteudoDiv').on('click', function(e)
{
ocultar();
e.preventDefault();
el = $(this).data('element');
$(el).slideToggle('slow');
});
});
</script>