Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. Learning jQuery

Learning jQuery

Scheduled Pinned Locked Moved JavaScript
javascripthtmltoolshelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DRAYKKO
    wrote on last edited by
    #1

    Greetings and Salutations! I'm not sure if this is the right group for this, but if not, please let me know where I should post my questions. I'm a novice to the world of jQuery and I've run into a snag (and can use some help). When I include the following line in my HTML file, the element doe not slide down as expected:

    $(document).ready(function(){	
    	$("#ContentHeader").slideDown(4000);
    });
    

    When I load the page the element appears without sliding down. I'm self taught using CodeAcademy and a text titled: "JavaScript & jQuery: The Missing Manual". Do I have the syntax correct? Here is the full code I'm using:

    <html lang="en">
    <head>

    <script>
    	$(document).ready(function(){	
    		$("#ContentHeader").slideDown(4000);
    	});
    </script>
    

    </head>
    <body>

    Andre Mitchell Stevens Swagger

    Ain't it cool???

    </body>
    </html>

    ======================= Every experience in life is a lesson to be learned A. Stevens B.S., Computer Science

    Richard DeemingR G 2 Replies Last reply
    0
    • D DRAYKKO

      Greetings and Salutations! I'm not sure if this is the right group for this, but if not, please let me know where I should post my questions. I'm a novice to the world of jQuery and I've run into a snag (and can use some help). When I include the following line in my HTML file, the element doe not slide down as expected:

      $(document).ready(function(){	
      	$("#ContentHeader").slideDown(4000);
      });
      

      When I load the page the element appears without sliding down. I'm self taught using CodeAcademy and a text titled: "JavaScript & jQuery: The Missing Manual". Do I have the syntax correct? Here is the full code I'm using:

      <html lang="en">
      <head>

      <script>
      	$(document).ready(function(){	
      		$("#ContentHeader").slideDown(4000);
      	});
      </script>
      

      </head>
      <body>

      Andre Mitchell Stevens Swagger

      Ain't it cool???

      </body>
      </html>

      ======================= Every experience in life is a lesson to be learned A. Stevens B.S., Computer Science

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      You haven't posted your CSS, but the first thing I would check is that you have display:none; set for your #ContentHeader element.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      D 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        You haven't posted your CSS, but the first thing I would check is that you have display:none; set for your #ContentHeader element.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        D Offline
        D Offline
        DRAYKKO
        wrote on last edited by
        #3

        Richard, Thanks for your feedback. Unfortunately that did not work. If I include "display: none" (without the quotes) the element doesn't appear at all (and I also tried using "slow" as the parameter, rather than "4000"). I also tried:

        $("#ContentHeader").hide().slideDown("slow");

        but that didn't work either... Here is my CSS (so far):

        h1, h2{
        color: #FF8000;
        text-align:center;
        }

        #ContentHeader{
        background-color: #000040;
        border-color: #FF8000;
        border-style:groove;
        border-radius: 5pt;
        border-width: 5pt;
        /* display: none; */
        }

        ======================= Every experience in life is a lesson to be learned A. Stevens B.S., Computer Science

        Richard DeemingR 1 Reply Last reply
        0
        • D DRAYKKO

          Greetings and Salutations! I'm not sure if this is the right group for this, but if not, please let me know where I should post my questions. I'm a novice to the world of jQuery and I've run into a snag (and can use some help). When I include the following line in my HTML file, the element doe not slide down as expected:

          $(document).ready(function(){	
          	$("#ContentHeader").slideDown(4000);
          });
          

          When I load the page the element appears without sliding down. I'm self taught using CodeAcademy and a text titled: "JavaScript & jQuery: The Missing Manual". Do I have the syntax correct? Here is the full code I'm using:

          <html lang="en">
          <head>

          <script>
          	$(document).ready(function(){	
          		$("#ContentHeader").slideDown(4000);
          	});
          </script>
          

          </head>
          <body>

          Andre Mitchell Stevens Swagger

          Ain't it cool???

          </body>
          </html>

          ======================= Every experience in life is a lesson to be learned A. Stevens B.S., Computer Science

          G Offline
          G Offline
          Graham Breach
          wrote on last edited by
          #4

          If that is your complete page, then you haven't included the script tag to load jQuery itself. It should look something like this:

          <script src="jquery.js"></script>

          The actual src= filename and path may be different.

          1 Reply Last reply
          0
          • D DRAYKKO

            Richard, Thanks for your feedback. Unfortunately that did not work. If I include "display: none" (without the quotes) the element doesn't appear at all (and I also tried using "slow" as the parameter, rather than "4000"). I also tried:

            $("#ContentHeader").hide().slideDown("slow");

            but that didn't work either... Here is my CSS (so far):

            h1, h2{
            color: #FF8000;
            text-align:center;
            }

            #ContentHeader{
            background-color: #000040;
            border-color: #FF8000;
            border-style:groove;
            border-radius: 5pt;
            border-width: 5pt;
            /* display: none; */
            }

            ======================= Every experience in life is a lesson to be learned A. Stevens B.S., Computer Science

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            You definitely need the display:none;. As Graham mentioned, you also need a <script> tag to include jQuery. If you don't have a local copy, you can use a CDN - for example:

            <script src="//code.jquery.com/jquery-1.10.2.min.js"></script>

            Here's a working example to play with: http://jsfiddle.net/Y5P7N/[^]


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups