Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Getting jQuery to work

  • This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #43281
    pillaw
    Member

    Hey,

    So I’ve been teaching myself jQuery using Codeacademy, and I have actually picked up a lot from it. One thing I’m not understanding is why this is not working. I’m sure my linking is wrong.. I might try writing the script directly on my index.html page.

    Can you guys see why this is not working?

    Codepen: [http://cdpn.io/DeBup](http://cdpn.io/DeBuphttp://cdpn.io/DeBup”)

    #127632
    Merri
    Participant

    Go to CodePen’s Editor mode.

    Push near the right side of the screen where it reads Ctrl 3

    You see a drop down where it reads “Latest version of…”

    Click the box below. Select jQuery from the list.

    #127634
    pillaw
    Member

    Added the latest version [here](http://cdpn.io/voCai “here”).

    #127635
    Merri
    Participant

    $(this).fadeOut(‘fast’,’0′)

    to

    $(this).fadeOut(‘fast’);

    The second parameter should be a function, or if it is a string, tell which “easing funtion” to use, of which there are natively only two supported: ‘swing’ and ‘linear’.

    #127636
    pillaw
    Member

    So I added your new code and it still seemed not to work.

    This is the jQuery code I am using. I don’t think I linked it correctly.. Do I have to link the jQuery page to my HTML one and do something else? All I have done is linked my jQuery page to my HTML page.

    Here is my jQuery code:
    $(document).ready(function() {
    $(‘.test’).click(function() {
    $(this).fadeOut(‘fast’)
    });
    });

    #127637
    Merri
    Participant

    http://codepen.io/Merri/pen/LwxKa

    If there is no other difference, you’re missing a semicolon.

    #127640
    pillaw
    Member

    Alright, so I added the semicolon praying it would work.. What a let down. I’m right there with you now.. I’m not sure why this code is not working. It seems to be set up perfectly fine?

    I updated the codepen if you want to take a look now. The jQuery code should make the div with the ID of object disappear when clicked.

    Codepen: [http://cdpn.io/xGnrd](http://cdpn.io/xGnrdhttp://cdpn.io/xGnrd”)

    #127641
    Merri
    Participant

    Works for me.

    #127643
    pillaw
    Member

    What browser are you using?

    #127644
    Merri
    Participant

    Firefox, Chrome, Opera and IE10 on Windows 8. All work fine for the last link.

    Try Ctrl + Shift + R (or Ctrl + R) to force full reload on CodePen and see if that fixes your issue.

    #127646
    pillaw
    Member

    Hmm.. Works on codepen now. I think there might be a problem with viewing my website through Dreamweaver on the internet? You know.. Using the “Preview/Debug in Browser” button on Dreamweaver instead of uploading it to a server.

    #127680
    pillaw
    Member

    Got it to work. Thanks Merri!

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘Other’ is closed to new topics and replies.