Reputation: 103
I'm trying to fade element out using jquery .... no luck
HTML element I'm struggling to fade out:
<div class="alert alert-success" id='success' style='margin-top:
20px;width:320px;' role="alert"><strong>Done.</strong><br>
Comment updated.</div>
Jquery bit:
<script type="text/javascript">
$(document).ready(function(){
$('#success').click(function() {
$(this).fadeOut();
});
});
</script>
and I'm using this cdn to pull Jquery from Jquery servers:
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"
integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n"
crossorigin="anonymous"></script>
Any idea why this is not working ?
Upvotes: 1
Views: 1223
Reputation: 760
as @ManuelOtto mentioned jQuery slim library does not include fadeOut. I was able to get your code to work with the following library
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
Upvotes: 2