1
Talk guys! All quiet?
So, I’m having some problems with the functioning of Jquery. I am simply trying to apply some animations and transitions to my site, such as toggle(), fadein() and etc, but several of them either don’t work, or work partially.
For example - while functions like Hide() and show() work, fadein() and slideToggle() do not work. The toggle() function in turn works, but when I pass the animation speed parameter through it, it changes nothing.
What I’m suspecting is that, because I used the Bootstrap template, the Jquery CDN that comes at the end of the body with it is giving some conflict with the CDN that I put in the head of the document. However, I’ve tried everything and nothing makes it work.
Can someone help me?
HEAD OF THE DOCUMENT
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../../../favicon.ico">
<title>PEC</title>
<script type='text/javascript' src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!--Javascript-->
<script type="text/javascript" src="js/script.js"></script>
<script type='text/javascript'>
$(document).ready(function(){
$("#historia").hide();
$("#metodologia").hide();
$("#material").hide();
$("#eventos").hide();
$('#btn-historia').click(function() {
$("#historia").toggle(6000);
});
$('#btn-metodologia').click(function() {
$("#metodologia").toggle(6000);
});
$('#btn-material').click(function() {
$("#material").toggle(6000);
});
$('#btn-eventos').click(function() {
$("#eventos").toggle(6000);
});
});
</script>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<!--CSS-->
<link href="css/estilo.css" rel="stylesheet" type="text/css">
<!--FONTS-->
<link href="https://fonts.googleapis.com/css?family=Archivo" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Krub" rel="stylesheet">
</head>
END OF THE BODY OF THE DOCUMENT
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
</body>
CARA saved me here! It worked! But one thing: since Jquery is at the end of the document, I must link my external js file after it or in the same head?
– Lucas Mendes Gabriel
@Lucasmendesgabriel nice young that good solved there, avoid importat more than a jQuery library, unless it is jQuery+jQueryUI for example... But importing two different versions of the same jQuery is not indicated...
– hugocsl
Man, thank you so much, it helped me so much! I’ll pay attention to this detail! I follow with this doubt - when I put Jquery in the document, I must then link my external js file after Jquery, at the end of body?
– Lucas Mendes Gabriel
@Lucasmendesgabriel Exact my dear! Any file . js that uses the dependencies of jQuery Devi come after it in the document. The default order of Bootstrap itself first is jQuery after it Popper and then Bootstrap.js, the fourth of the list would be your Custom.js with your scripts. If you’re still using some other Owlcarousel library or something like it should also come after jQuery, but before your Custom.js [] s
– hugocsl
Hugo, I don’t know how to thank you, friend! I really broke my head with this! Thank you very much!
– Lucas Mendes Gabriel
@Lucasmendesgabriel without problems, I’ve already caught it with rss, I’m designer, I’m not dev. so js is always playing me rss play. Success with the project!
– hugocsl
Man, I’m a student of web dev and I’m freelancing to do. So I’m getting it right here! hahahaha
– Lucas Mendes Gabriel
@Lucasmendesgabriel you will learn more doing freelance than in Facul :D. Childbirth pranks Stackoverflow is there for this, to help with technical issues even. Here are a lot of people hurt, just wonder at the question that always has someone to answer.
– hugocsl