Question

<!DOCTYPE html>
<html>
    <head>
        <title>
        </title>
        <style>
        </style>
        <script type="text/javascript">
            $(document).ready(function {
          $('img').slideDown('slow');
      });
        </script>
    </head>
    <body>
        <img src="images\sjmak-music-logo.jpeg"/>
    </body>
</html>

The simple code example above is not working; I am attempting to simply make the image slide down from the top of the screen but it stays static. I also attempted to use 'display: none' on the image, but the image remains hidden instead of sliding down from the top.

Was it helpful?

Solution

You need to include jQuery library file to use jQuery methods.

In the below sample a jquery cdn version is added. Also to slide down an image it has to be hidden first

<!DOCTYPE html>
<html>
    <head>
        <title>
        </title>
        <style>
        </style>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
          $('img').slideDown('slow');
      });
        </script>
    </head>
    <body>
        <img src="images\sjmak-music-logo.jpeg" style="display: none"/>
    </body>
</html>

Demo: Fiddle

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top