JQuery fadeIn () not working

Description: I am trying to use fadeIn()my container using jquery, but it does not work. I am new to this, only fresh from the jacery course in codec.

Problem: The method I wrote in the myScript.js file does not seem to work. The syntax looks fine compared to other examples. I got the js file associated with the html file as follows:

<script type="text/javascript" src="/Content/js/myScript.js"></script>

This is my index.cshtml file where I created a container for some navigation:

 <div class="container" id="fade">
        //some other buttons, divs, etc
 </div>

This is my custom js file that I included:

$(document).ready(function () {
    $('#fade').fadeIn('slow');
});
+4
source share
2 answers

div , , , . , html :

<div class="container" id="fade" style="display: none;">
    //some other buttons, divs, etc
</div>
+7

, #fade .

HTML

 <div class="container" id="fade">
        //some other buttons, divs, etc
 </div>

CSS

#fade { display: none }

JS

$(document).ready(function () {
    $('#fade').fadeIn('slow');
});
+1

All Articles